How to test own WebSocket client implementation against Autobahn Testsuite Fuzzingserver?

#1

Hello everybody!

Due to the fact that I have an use case (Android app) where I need more WebSocket protocol features than available through the WebSocket JS API (which Autobahn Android mimics), I have started to develop a WebSocket client implementing a bigger subset of the RFC6455. (can be found at: https://github.com/justphil/nephila-websocket-client)

Till now I have tested my implementation against the Grizzly and Apache Tomcat WebSocket servers (both are Java based servers).
Now I wonder how I can use the fuzzingserver in order to put my own client implementation to the acid?

I’ve installed Python 2.7.3, SetupTools0.6c11, Twisted-12.2.0.win-amd64-py2.7 and the Autobahn Testsuite following your explanations (http://autobahn.ws/testsuite/installation). And already got the fuzzingserver running (checked Chrome against the 295 tests). But I cannot figure out how to run my own client against the fuzzingserver.

I’ve written a simple application that connects to the fuzzingserver and sends a simple text frame “test”. When I execute this application the fuzzingserver throws an exception (Grizzly / Tomcat reacts perfectly okay):

Entering direct command mode for peer 127.0.0.1:53439
Unhandled Error
Traceback (most recent call last):
File “C:\Dev\SDKs\Python2.7.3\lib\site-packages\twisted\python\log.py”, line 84, in callWithLogger
return callWithContext({“system”: lp}, func, *args, **kw)
File “C:\Dev\SDKs\Python2.7.3\lib\site-packages\twisted\python\log.py”, line 69, in callWithContext
return context.call({ILogContext: newCtx}, func, *args, **kw)
File “C:\Dev\SDKs\Python2.7.3\lib\site-packages\twisted\python\context.py”, line 118, in callWithContext
return self.currentContext().callWithContext(ctx, func, *args, **kw)
File “C:\Dev\SDKs\Python2.7.3\lib\site-packages\twisted\python\context.py”, line 81, in callWithContext
return func(*args,**kw)
— —
File “C:\Dev\SDKs\Python2.7.3\lib\site-packages\twisted\internet\selectreactor.py”, line 150, in _doReadOrWrite
why = getattr(selectable, method)()
File “C:\Dev\SDKs\Python2.7.3\lib\site-packages\twisted\internet\tcp.py”, line 203, in doRead
return self._dataReceived(data)
File “C:\Dev\SDKs\Python2.7.3\lib\site-packages\twisted\internet\tcp.py”, line 209, in _dataReceived
rval = self.protocol.dataReceived(data)
File “C:\Dev\SDKs\Python2.7.3\lib\site-packages\autobahn-0.5.8-py2.7.egg\autobahn\websocket.py”, line 1152, in dataReceived
self.consumeData()
File “C:\Dev\SDKs\Python2.7.3\lib\site-packages\autobahn-0.5.8-py2.7.egg\autobahn\websocket.py”, line 1168, in consumeData
while self.processData() and self.state != WebSocketProtocol.STATE_CLOSED:
File “C:\Dev\SDKs\Python2.7.3\lib\site-packages\autobahn-0.5.8-py2.7.egg\autobahn\websocket.py”, line 1312, in processData
return self.processDataHybi()
File “C:\Dev\SDKs\Python2.7.3\lib\site-packages\autobahn-0.5.8-py2.7.egg\autobahn\websocket.py”, line 1599, in processDataHybi
fr = self.onFrameEnd()
File “C:\Dev\SDKs\Python2.7.3\lib\site-packages\autobahn-0.5.8-py2.7.egg\autobahn\websocket.py”, line 1674, in onFrameEnd
self.onMessageEnd()
File “C:\Dev\SDKs\Python2.7.3\lib\site-packages\autobahn-0.5.8-py2.7.egg\autobahn\websocket.py”, line 593, in onMessageEnd
self.onMessage(payload, self.message_opcode == WebSocketProtocol.MESSAGE_TYPE_BINARY)
File “C:\Dev\SDKs\Python2.7.3\lib\site-packages\autobahntestsuite-0.5.2-py2.7.egg\autobahntestsuite\fuzzing.py”, line 381, in onMessage
raise Exception(“could not parse command”)
exceptions.Exception: could not parse command

Any hints on this one?

Thanks in advance!

Phil

0 Likes

#2

Hello everybody!

Due to the fact that I have an use case (Android app) where I need more
WebSocket protocol features than available through the WebSocket JS API
(which Autobahn Android mimics), I have started to develop a WebSocket
client implementing a bigger subset of the RFC6455. (can be found at:

Huh? AutobahnAndroid implements the complete RFC6455 spec.

https://github.com/justphil/nephila-websocket-client)

Till now I have tested my implementation against the Grizzly and Apache
Tomcat WebSocket servers (both are Java based servers).
Now I wonder how I can use the fuzzingserver in order to put my own
client implementation to the acid?

I've installed Python 2.7.3, SetupTools0.6c11,
Twisted-12.2.0.win-amd64-py2.7 and the Autobahn Testsuite following your
explanations (http://autobahn.ws/testsuite/installation). And already
got the fuzzingserver running (checked Chrome against the 295 tests).
But I cannot figure out how to run my own client against the fuzzingserver.

You can peek at the test client for AutobahnAndroid:

https://github.com/tavendo/AutobahnAndroid/tree/master/Demo/TestSuiteClient

Basically you open WS URI formed like

sess.connect(mWsUri.getText() + "/runCase?case=" + currCase + "&agent=" + mAgent.getText()

https://github.com/tavendo/AutobahnAndroid/blob/master/Demo/TestSuiteClient/src/de/tavendo/autobahn/testsuiteclient/MainActivity.java#L103

and then only respond to received WS messages by echoing them. You are not supposed to send WS messages unsolicited.

Hope that helps,
Tobias

···

Am 27.09.2012 16:59, schrieb justphil:

0 Likes

#3

Hey Tobias!

Thank you for your fast response!

Hello everybody!

Due to the fact that I have an use case (Android app) where I need more

WebSocket protocol features than available through the WebSocket JS API

(which Autobahn Android mimics), I have started to develop a WebSocket

client implementing a bigger subset of the RFC6455. (can be found at:

Huh? AutobahnAndroid implements the complete RFC6455 spec.

Ah okay, I haven’t realized that when I was looking for a Android WS solution a couple of months ago.

But, nevertheless I still need more control and logic on how to react to server’s ping frames, etc.

https://github.com/justphil/nephila-websocket-client)

Till now I have tested my implementation against the Grizzly and Apache

Tomcat WebSocket servers (both are Java based servers).

Now I wonder how I can use the fuzzingserver in order to put my own

client implementation to the acid?

I’ve installed Python 2.7.3, SetupTools0.6c11,

Twisted-12.2.0.win-amd64-py2.7 and the Autobahn Testsuite following your

explanations (http://autobahn.ws/testsuite/installation). And already

got the fuzzingserver running (checked Chrome against the 295 tests).

But I cannot figure out how to run my own client against the fuzzingserver.

You can peek at the test client for AutobahnAndroid:

https://github.com/tavendo/AutobahnAndroid/tree/master/Demo/TestSuiteClient

Basically you open WS URI formed like

sess.connect(mWsUri.getText() + “/runCase?case=” + currCase + “&agent=”

  • mAgent.getText()

https://github.com/tavendo/AutobahnAndroid/blob/master/Demo/TestSuiteClient/src/de/tavendo/autobahn/testsuiteclient/MainActivity.java#L103

and then only respond to received WS messages by echoing them. You are
not supposed to send WS messages unsolicited.

Okay, thank you! I’ll have a try.

Hope that helps,

Definitively!

···

Am Donnerstag, 27. September 2012 19:35:21 UTC+2 schrieb Tobias Oberstein:

Am 27.09.2012 16:59, schrieb justphil:

Tobias

0 Likes