Echo server not working on remote server

#1

Hello,

i just starded tinkering with Websockets and Autobahn python server, i’m trying to make the echo sample server work on a remote server (a VPS with debian 7 on a OpenVZ container).

I changed the javascript client example to point to my server, i get a successfull handshake but when i try to send the Hello, World ! message the server disconnects.

The code i’m using is the same ad the examples from the Autobhan website, with just the URI changed.

This is the log i get when i’m enabling Debug on the server:

2013-07-14 14:20:33-0700 [-] Log opened.

2013-07-14 14:20:33-0700 [-] WebSocketServerFactory starting on 9000

2013-07-14 14:20:33-0700 [-] Starting factory <autobahn.websocket.WebSocketServerFactory instance at 0xa0cc68c>

2013-07-14 14:20:45-0700 [autobahn.websocket.WebSocketServerFactory] connection accepted from peer 2.236.105.96:54873

2013-07-14 14:20:45-0700 [EchoServerProtocol,0,2.236.105.96] RX Octets from 2.236.105.96:54873 : octets = 474554202f20485454502f312e310d0a557067726164653a20776562736f636b65740d0a436f6e6e656374696f6e3a20557067726164650d0a486f73743a2073747261746d61702e61627374726163742d626c75652e6e65743a393030300d0a4f726967696e3a206e756c6c0d0a507261676d613a206e6f2d63616368650d0a43616368652d436f6e74726f6c3a206e6f2d63616368650d0a5365632d576562536f636b65742d4b65793a20373358626e52677a344a68443438336652474a3333773d3d0d0a5365632d576562536f636b65742d56657273696f6e3a2031330d0a5365632d576562536f636b65742d457874656e73696f6e733a20782d7765626b69742d6465666c6174652d6672616d650d0a557365722d4167656e743a204d6f7a696c6c612f352e3020285831313b204c696e7578206936383629204170706c655765624b69742f3533372e333620284b48544d4c2c206c696b65204765636b6f29204368726f6d652f32372e302e313435332e313130205361666172692f3533372e33360d0a0d0a

2013-07-14 14:20:45-0700 [EchoServerProtocol,0,2.236.105.96] received HTTP request:

GET / HTTP/1.1

Upgrade: websocket

Connection: Upgrade

Host: stratmap.abstract-blue.net:9000

Origin: null

Pragma: no-cache

Cache-Control: no-cache

Sec-WebSocket-Key: 73XbnRgz4JhD483fRGJ33w==

Sec-WebSocket-Version: 13

Sec-WebSocket-Extensions: x-webkit-deflate-frame

User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36

2013-07-14 14:20:45-0700 [EchoServerProtocol,0,2.236.105.96] received HTTP status line in opening handshake : GET / HTTP/1.1

2013-07-14 14:20:45-0700 [EchoServerProtocol,0,2.236.105.96] received HTTP headers in opening handshake : {‘origin’: u’null’, ‘upgrade’: u’websocket’, ‘sec-websocket-extensions’: u’x-webkit-deflate-frame’, ‘sec-websocket-version’: u’13’, ‘host’: u’stratmap.abstract-blue.net:9000’, ‘sec-websocket-key’: u’73XbnRgz4JhD483fRGJ33w==’, ‘user-agent’: u’Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36’, ‘connection’: u’Upgrade’, ‘pragma’: u’no-cache’, ‘cache-control’: u’no-cache’}

2013-07-14 14:20:45-0700 [EchoServerProtocol,0,2.236.105.96] client requested extensions we don’t support ([u’x-webkit-deflate-frame’])

2013-07-14 14:20:45-0700 [EchoServerProtocol,0,2.236.105.96] sending HTTP response:

HTTP/1.1 101 Switching Protocols

Server: AutobahnPython/0.5.14

Upgrade: WebSocket

Connection: Upgrade

Sec-WebSocket-Accept: k3maF1R5PCQj6ueVnTHlkDDJq/4=

2013-07-14 14:20:45-0700 [EchoServerProtocol,0,2.236.105.96] TX Octets to 2.236.105.96:54873 : sync = False, octets = 485454502f312e312031303120537769746368696e672050726f746f636f6c730d0a5365727665723a204175746f6261686e507974686f6e2f302e352e31340d0a557067726164653a20576562536f636b65740d0a436f6e6e656374696f6e3a20557067726164650d0a5365632d576562536f636b65742d4163636570743a206b336d61463152355043516a367565566e54486c6b44444a712f343d0d0a0d0a

2013-07-14 14:20:48-0700 [EchoServerProtocol,0,2.236.105.96] connection from 2.236.105.96:54873 lost

Using tcpdump to log what’s happening on the client side i see that when i click the send button i get a message that doesn’t contain the ascii string.

Am I missing something ? Any help would be really appreciated :slight_smile:

Riccardo.

0 Likes

#2

Okay solved the problem. My Antivirus, BitDefender, was blocking the websocket traffic without saying a thing about doing it or giving me the possibility to make it stop.

···

Il giorno domenica 14 luglio 2013 23:26:43 UTC+2, Riccardo Ascenzi ha scritto:

Hello,
i just starded tinkering with Websockets and Autobahn python server, i’m trying to make the echo sample server work on a remote server (a VPS with debian 7 on a OpenVZ container).

I changed the javascript client example to point to my server, i get a successfull handshake but when i try to send the Hello, World ! message the server disconnects.

The code i’m using is the same ad the examples from the Autobhan website, with just the URI changed.

This is the log i get when i’m enabling Debug on the server:

2013-07-14 14:20:33-0700 [-] Log opened.

2013-07-14 14:20:33-0700 [-] WebSocketServerFactory starting on 9000

2013-07-14 14:20:33-0700 [-] Starting factory <autobahn.websocket.WebSocketServerFactory instance at 0xa0cc68c>

2013-07-14 14:20:45-0700 [autobahn.websocket.WebSocketServerFactory] connection accepted from peer 2.236.105.96:54873

2013-07-14 14:20:45-0700 [EchoServerProtocol,0,2.236.105.96] RX Octets from 2.236.105.96:54873 : octets = 474554202f20485454502f312e310d0a557067726164653a20776562736f636b65740d0a436f6e6e656374696f6e3a20557067726164650d0a486f73743a2073747261746d61702e61627374726163742d626c75652e6e65743a393030300d0a4f726967696e3a206e756c6c0d0a507261676d613a206e6f2d63616368650d0a43616368652d436f6e74726f6c3a206e6f2d63616368650d0a5365632d576562536f636b65742d4b65793a20373358626e52677a344a68443438336652474a3333773d3d0d0a5365632d576562536f636b65742d56657273696f6e3a2031330d0a5365632d576562536f636b65742d457874656e73696f6e733a20782d7765626b69742d6465666c6174652d6672616d650d0a557365722d4167656e743a204d6f7a696c6c612f352e3020285831313b204c696e7578206936383629204170706c655765624b69742f3533372e333620284b48544d4c2c206c696b65204765636b6f29204368726f6d652f32372e302e313435332e313130205361666172692f3533372e33360d0a0d0a

2013-07-14 14:20:45-0700 [EchoServerProtocol,0,2.236.105.96] received HTTP request:

GET / HTTP/1.1

Upgrade: websocket

Connection: Upgrade

Host: stratmap.abstract-blue.net:9000

Origin: null

Pragma: no-cache

Cache-Control: no-cache

Sec-WebSocket-Key: 73XbnRgz4JhD483fRGJ33w==

Sec-WebSocket-Version: 13

Sec-WebSocket-Extensions: x-webkit-deflate-frame

User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36

2013-07-14 14:20:45-0700 [EchoServerProtocol,0,2.236.105.96] received HTTP status line in opening handshake : GET / HTTP/1.1

2013-07-14 14:20:45-0700 [EchoServerProtocol,0,2.236.105.96] received HTTP headers in opening handshake : {‘origin’: u’null’, ‘upgrade’: u’websocket’, ‘sec-websocket-extensions’: u’x-webkit-deflate-frame’, ‘sec-websocket-version’: u’13’, ‘host’: u’stratmap.abstract-blue.net:9000’, ‘sec-websocket-key’: u’73XbnRgz4JhD483fRGJ33w==’, ‘user-agent’: u’Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36’, ‘connection’: u’Upgrade’, ‘pragma’: u’no-cache’, ‘cache-control’: u’no-cache’}

2013-07-14 14:20:45-0700 [EchoServerProtocol,0,2.236.105.96] client requested extensions we don’t support ([u’x-webkit-deflate-frame’])

2013-07-14 14:20:45-0700 [EchoServerProtocol,0,2.236.105.96] sending HTTP response:

HTTP/1.1 101 Switching Protocols

Server: AutobahnPython/0.5.14

Upgrade: WebSocket

Connection: Upgrade

Sec-WebSocket-Accept: k3maF1R5PCQj6ueVnTHlkDDJq/4=

2013-07-14 14:20:45-0700 [EchoServerProtocol,0,2.236.105.96] TX Octets to 2.236.105.96:54873 : sync = False, octets = 485454502f312e312031303120537769746368696e672050726f746f636f6c730d0a5365727665723a204175746f6261686e507974686f6e2f302e352e31340d0a557067726164653a20576562536f636b65740d0a436f6e6e656374696f6e3a20557067726164650d0a5365632d576562536f636b65742d4163636570743a206b336d61463152355043516a367565566e54486c6b44444a712f343d0d0a0d0a

2013-07-14 14:20:48-0700 [EchoServerProtocol,0,2.236.105.96] connection from 2.236.105.96:54873 lost

Using tcpdump to log what’s happening on the client side i see that when i click the send button i get a message that doesn’t contain the ascii string.

Am I missing something ? Any help would be really appreciated :slight_smile:

Riccardo.

0 Likes

#3

2013-07-14 14:20:45-0700 [EchoServerProtocol,0,2.236.105.96] sending
HTTP response:
HTTP/1.1 101 Switching Protocols
Server: AutobahnPython/0.5.14
Upgrade: WebSocket
Connection: Upgrade
Sec-WebSocket-Accept: k3maF1R5PCQj6ueVnTHlkDDJq/4=
2013-07-14 14:20:45-0700 [EchoServerProtocol,0,2.236.105.96] TX Octets
to 2.236.105.96:54873 : sync = False, octets =
485454502f312e312031303120537769746368696e672050726f746f636f6c730d0a5365727665723a204175746f6261686e507974686f6e2f302e352e31340d0a557067726164653a20576562536f636b65740d0a436f6e6e656374696f6e3a20557067726164650d0a5365632d576562536f636b65742d4163636570743a206b336d61463152355043516a367565566e54486c6b44444a712f343d0d0a0d0a
2013-07-14 14:20:48-0700 [EchoServerProtocol,0,2.236.105.96] connection
from 2.236.105.96:54873 lost

From above log, it seems the client closes the connection after receiving the opening handshake response from the server.

Do you have any intermediaries (like proxies, firewalls, etc) in between the client and server?

/Tobias

0 Likes

#4

Okay solved the problem. My Antivirus, BitDefender, was blocking the
websocket traffic without saying a thing about doing it or giving me the
possibility to make it stop.

Ah .. intermediaries!

Personally, I am not running any of those fancy "personal firewall" thingies for exactly this reason: they do more harm than good. Problems hard to detect etc.

It would be interesting to find out if BitDefender would interfere with WebSocket when using WSS - that is secure WS. IOW: does BitDefender intercept TLS connections?

/Tobias

···

Am 15.07.2013 21:13, schrieb Riccardo Ascenzi:

Il giorno domenica 14 luglio 2013 23:26:43 UTC+2, Riccardo Ascenzi ha
scritto:

    Hello,
    i just starded tinkering with Websockets and Autobahn python server,
    i'm trying to make the echo sample server work on a remote server (a
    VPS with debian 7 on a OpenVZ container).
    I changed the javascript client example to point to my server, i get
    a successfull handshake but when i try to send the Hello, World !
    message the server disconnects.
    The code i'm using is the same ad the examples from the Autobhan
    website, with just the URI changed.

    This is the log i get when i'm enabling Debug on the server:

    2013-07-14 14:20:33-0700 [-] Log opened.
    2013-07-14 14:20:33-0700 [-] WebSocketServerFactory starting on 9000
    2013-07-14 14:20:33-0700 [-] Starting factory
    <autobahn.websocket.WebSocketServerFactory instance at 0xa0cc68c>
    2013-07-14 14:20:45-0700 [autobahn.websocket.WebSocketServerFactory]
    connection accepted from peer 2.236.105.96:54873
    <http://2.236.105.96:54873>
    2013-07-14 14:20:45-0700 [EchoServerProtocol,0,2.236.105.96] RX
    Octets from 2.236.105.96:54873 <http://2.236.105.96:54873> : octets
    =
    474554202f20485454502f312e310d0a557067726164653a20776562736f636b65740d0a436f6e6e656374696f6e3a20557067726164650d0a486f73743a2073747261746d61702e61627374726163742d626c75652e6e65743a393030300d0a4f726967696e3a206e756c6c0d0a507261676d613a206e6f2d63616368650d0a43616368652d436f6e74726f6c3a206e6f2d63616368650d0a5365632d576562536f636b65742d4b65793a20373358626e52677a344a68443438336652474a3333773d3d0d0a5365632d576562536f636b65742d56657273696f6e3a2031330d0a5365632d576562536f636b65742d457874656e73696f6e733a20782d7765626b69742d6465666c6174652d6672616d650d0a557365722d4167656e743a204d6f7a696c6c612f352e3020285831313b204c696e7578206936383629204170706c655765624b69742f3533372e333620284b48544d4c2c206c696b65204765636b6f29204368726f6d652f32372e302e313435332e313130205361666172692f3533372e33360d0a0d0a
    2013-07-14 14:20:45-0700 [EchoServerProtocol,0,2.236.105.96]
    received HTTP request:
    GET / HTTP/1.1
    Upgrade: websocket
    Connection: Upgrade
    Host: stratmap.abstract-blue.net:9000
    <http://stratmap.abstract-blue.net:9000>
    Origin: null
    Pragma: no-cache
    Cache-Control: no-cache
    Sec-WebSocket-Key: 73XbnRgz4JhD483fRGJ33w==
    Sec-WebSocket-Version: 13
    Sec-WebSocket-Extensions: x-webkit-deflate-frame
    User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML,
    like Gecko) Chrome/27.0.1453.110 Safari/537.36
    2013-07-14 14:20:45-0700 [EchoServerProtocol,0,2.236.105.96]
    received HTTP status line in opening handshake : GET / HTTP/1.1
    2013-07-14 14:20:45-0700 [EchoServerProtocol,0,2.236.105.96]
    received HTTP headers in opening handshake : {'origin': u'null',
    'upgrade': u'websocket', 'sec-websocket-extensions':
    u'x-webkit-deflate-frame', 'sec-websocket-version': u'13', 'host':
    u'stratmap.abstract-blue.net:9000
    <http://stratmap.abstract-blue.net:9000>', 'sec-websocket-key':
    u'73XbnRgz4JhD483fRGJ33w==', 'user-agent': u'Mozilla/5.0 (X11; Linux
    i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110
    Safari/537.36', 'connection': u'Upgrade', 'pragma': u'no-cache',
    'cache-control': u'no-cache'}
    2013-07-14 14:20:45-0700 [EchoServerProtocol,0,2.236.105.96] client
    requested extensions we don't support ([u'x-webkit-deflate-frame'])
    2013-07-14 14:20:45-0700 [EchoServerProtocol,0,2.236.105.96] sending
    HTTP response:
    HTTP/1.1 101 Switching Protocols
    Server: AutobahnPython/0.5.14
    Upgrade: WebSocket
    Connection: Upgrade
    Sec-WebSocket-Accept: k3maF1R5PCQj6ueVnTHlkDDJq/4=
    2013-07-14 14:20:45-0700 [EchoServerProtocol,0,2.236.105.96] TX
    Octets to 2.236.105.96:54873 <http://2.236.105.96:54873> : sync =
    False, octets =
    485454502f312e312031303120537769746368696e672050726f746f636f6c730d0a5365727665723a204175746f6261686e507974686f6e2f302e352e31340d0a557067726164653a20576562536f636b65740d0a436f6e6e656374696f6e3a20557067726164650d0a5365632d576562536f636b65742d4163636570743a206b336d61463152355043516a367565566e54486c6b44444a712f343d0d0a0d0a
    2013-07-14 14:20:48-0700 [EchoServerProtocol,0,2.236.105.96]
    connection from 2.236.105.96:54873 <http://2.236.105.96:54873> lost

    Using tcpdump to log what's happening on the client side i see that
    when i click the send button i get a message that doesn't contain
    the ascii string.

    Am I missing something ? Any help would be really appreciated :slight_smile:

    Riccardo.

--
You received this message because you are subscribed to the Google
Groups "Autobahn" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to autobahnws+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 Likes