Nethravathitcs / unitt

Automatically exported from code.google.com/p/unitt
0 stars 0 forks source link

Connecting to websocket over internet does not work, localhost it is possible but I can't send #36

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

Doing what is shown in
http://code.google.com/p/unitt/wiki/UnittWebSocketClient
and then replacing the url by "ws://echo.websocket.org".

What is the expected output? What do you see instead?

2011-12-13 15:59:41.417 Tests[3618:207] WebSocketTest/testWebSocket  
2011-12-13 15:59:42.904 Tests[3618:207] Re-running: WebSocketTest/testWebSocket 
<GHTest: 0x797c0e0>
2011-12-13 15:59:42.927 Tests[3618:207] WebSocketTest/testWebSocket ✔ 0.02s
2011-12-13 15:59:43.062 Tests[3618:207] Oops. An error occurred.
2011-12-13 15:59:43.064 Tests[3618:207] Oops. It closed.

What version of the product are you using? On what operating system?
UnittWebSocketClient 0.9.4
XCode 4.2
Mac OS 10.6.8
iPhone 5.0 Simulator

Please provide any additional information below.
I followed 
http://jbraffoul.wordpress.com/2011/09/24/a-node-js-websocket-server-on-ubuntu-1
1-04/ and started a local server. Connecting to it as 
"ws://localhost:8000/test" *does* work (text "connection is open") but as soon 
as I do the following it gives me the same error:

TestWebSocket* myWS = [[TestWebSocket alloc] init];
[myWS startMyWebSocket];
 [[myWS ws]sendText:@"testString"];

Original issue reported on code.google.com by kon...@gmx.at on 13 Dec 2011 at 3:08

GoogleCodeExporter commented 8 years ago
To clarify:

TestWebSocket* myWS = [[TestWebSocket alloc] init];
[myWS startMyWebSocket];

Does work but 

 [[myWS ws]sendText:@"testString"];

gives me the error at the end.

Original comment by kon...@gmx.at on 13 Dec 2011 at 3:11

GoogleCodeExporter commented 8 years ago
I have tested the client against ws://echo.websocket.org and everything works 
fine. Can you make sure you don't have another issue you are experiencing. If 
you are connecting to node, make sure you set the correct client version or 
your connection will not work.

Original comment by joshuadmorris@gmail.com on 14 Dec 2011 at 4:02

GoogleCodeExporter commented 8 years ago
Hi!

I sucessfully managed to send to ws://echo.websocket.org now but only with 
the 00 version and not with the latest one. With the latest one and the 
test class I still get:

Did open
Error: errorDesc=(null), failureReason=(null)
Status Code: 1000
Close Message: (null)
Error: errorDesc=(null), failureReason=(null)

Where the Config is:

WebSocketConnectConfig* config  [WebSocketConnectConfig 
configWithURLString:@"ws://echo.websocket.org" 
origin:@"http://websocket.org" protocols:nil tlsSettings:nil headers:nil 
verifySecurityKey:NO extensions:nil];

Is the version of the latest one too high to work with echo.websocket.org? 
How can I set the version? Also I have a server which expects a special key 
and I found a constructor with the parameter useKeys but how can I set the 
key itself? Is there a forum where I can ask basic questions about it?

Thank you very much,
Konrad Höffner        

Original comment by kon...@gmx.at on 14 Dec 2011 at 5:19

GoogleCodeExporter commented 8 years ago
The latest one is too high to work with websocket.org. This is one of the 
challenges with the current state of web sockets. There are about 17 different 
spec versions. The good news is that the latest version is rumored to be the 
final one or very close to it. So hopefully this will cease to be an issue 
soon. There are two major flavors of web socket specs right now. The legacy 
one, which is very simple to implement but has all kinds of issues is 
represented by the WebSocket00 class in Unitt. The more recent version, that 
will become the final web socket version, is represented by the WebSocket class 
in Unitt. You can specify one of 3 major versions (7, 8, 10). I am working on 
the latest version (17) right now. There is a property for version on the 
WebSocketConnectConfig. Does that answer your question? I am going to mark this 
as invalid so it won't confuse others.

Original comment by joshuadmorris@gmail.com on 15 Dec 2011 at 8:41