Bypassing Apache everything seems to work fine, that's why I think it's a
misconfiguration of the Web server.
This is the complete configuration:
<VirtualHost *:80>
ServerName my_server_name
ProxyPreserveHost On
ProxyRequests Off
<Proxy *>
Order Deny,Allow
Allow From All
</Proxy>
ProxyPass /socketio ws://localhost:8081
ProxyPassReverse /socketio ws://localhost:8081
ProxyPass / localhost:8081
ProxyPassReverse / localhost:8081
</VirtualHost>
Il giorno mercoledì 9 marzo 2016 18:16:57 UTC+1, Petru Ciobanu ha scritto:
>
> to exclude apache from equation or to confirm that he is introducing the
> error, you should try to run your application without it.
> have you tried to run your application without using apache and without
> using a proxy? was the result the same?
>
> On Wed, 9 Mar 2016 at 15:58 Alessandro Molina <[email protected]
> <javascript:>> wrote:
>
>> That's odd. It looks like your server is not promoting the request to a
>> websocket request.
>> wsgi.websocket key in eviron should be provided by the webserver and
>> should contain the I/O for the socket promoted to websocket
>>
>>
>> On Wed, Mar 9, 2016 at 12:13 PM, Luca Verardi <[email protected]
>> <javascript:>> wrote:
>>
>>> Hi Alessandro and Petru.
>>> The client returns this 406 error message
>>>
>>> 12:03:31,265 INFO [geventwebsocket.handler] 127.0.0.1 - - [2016-03-09
>>> 12:03:31] "GET /socketio/1/websocket/992153868824 HTTP/1.1" 406 1520
>>> 0.008378
>>> Traceback (most recent call last):
>>> File
>>> "/home/test/project/lib/python2.7/site-packages/gevent/greenlet.py", line
>>> 327, in run
>>> result = self._run(*self.args, **self.kwargs)
>>> File
>>> "/home/test/project/lib/python2.7/site-packages/socketio/server.py", line
>>> 124, in handle
>>> handler.handle()
>>> File
>>> "/home/test/project/lib/python2.7/site-packages/gevent/pywsgi.py", line
>>> 184, in handle
>>> result = self.handle_one_request()
>>> File
>>> "/home/test/project/lib/python2.7/site-packages/gevent/pywsgi.py", line
>>> 321, in handle_one_request
>>> self.handle_one_response()
>>> File
>>> "/home/test/project/lib/python2.7/site-packages/socketio/handler.py", line
>>> 170, in handle_one_response
>>> self.transport.do_exchange(socket, request_method)
>>> File
>>> "/home/test/project/lib/python2.7/site-packages/socketio/transports.py",
>>> line 241, in do_exchange
>>> websocket = self.handler.environ['wsgi.websocket']
>>> KeyError: 'wsgi.websocket'
>>> <Greenlet at 0x7f671878faf0: <bound method SocketIOServer.handle of
>>> <SocketIOServer at 0x7f672392d650 fileno=8 address=0.0.0.0:8081>>(<socket
>>> at 0x7f6718630f10 fileno=[Errno 9] Bad fil, ('127.0.0.1', 34815))> failed
>>> with KeyError
>>>
>>> Could be an apache misconfiguration?
>>>
>>> Il giorno martedì 8 marzo 2016 12:06:05 UTC+1, Alessandro Molina ha
>>> scritto:
>>>>
>>>> 406 usually means you got a plain http request to a websocket endpoint.
>>>>
>>>> As the gevent-socketio server should always set socketio value in
>>>> environ it should only happen if you are accessing a socketio controller
>>>> without a socketio server
>>>> Il 07/mar/2016 17:49, "Petru Ciobanu" <[email protected]> ha scritto:
>>>>
>>>>> Hi Luca, could you explain what 404 and 406 error codes means? ... are
>>>>> this errors related to each others or they indicate that there are two
>>>>> different problems?
>>>>>
>>>>> On Fri, 4 Mar 2016 at 15:22 Luca Verardi <[email protected]> wrote:
>>>>>
>>>>>> Hello everybody, I'm having problems using tgext.socketio's available
>>>>>> websockets, frequently running into HTTP 404 or 406 errors.
>>>>>> Web requests are served by Apache 2.2, and I can't update it due to
>>>>>> workspace constraints.
>>>>>> Even compiling wstunnel for Apache didn't solve the problem.
>>>>>> This is the current configuration for VirtualHost:
>>>>>>
>>>>>> ProxyPass /socketio ws://localhost:8081
>>>>>> ProxyPassReverse /socketio ws://localhost:8081
>>>>>>
>>>>>> My app's software stack contains:
>>>>>>
>>>>>> TurboGears2 2.3.7
>>>>>> tgext.socketio 0.0.1
>>>>>>
>>>>>> and my [server:main] is:
>>>>>>
>>>>>> use = egg:tgext.socketio#socketio
>>>>>> socketio_resource = socketio
>>>>>> host = 0.0.0.0
>>>>>> port = 8081
>>>>>>
>>>>>> --
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "TurboGears" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>> send an email to [email protected].
>>>>>> To post to this group, send email to [email protected].
>>>>>> Visit this group at https://groups.google.com/group/turbogears.
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "TurboGears" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>>> an email to [email protected].
>>>>> To post to this group, send email to [email protected].
>>>>> Visit this group at https://groups.google.com/group/turbogears.
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "TurboGears" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected] <javascript:>.
>>> To post to this group, send email to [email protected]
>>> <javascript:>.
>>> Visit this group at https://groups.google.com/group/turbogears.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "TurboGears" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected]
>> <javascript:>.
>> Visit this group at https://groups.google.com/group/turbogears.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
--
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/turbogears.
For more options, visit https://groups.google.com/d/optout.