jmesnil / stomp-websocket

Stomp client for Web browsers and node.js apps
http://jmesnil.net/stomp-websocket/doc/
Apache License 2.0
1.43k stars 586 forks source link

iOS Support #33

Closed kevinpreynolds closed 11 years ago

kevinpreynolds commented 11 years ago

I am using ActiveMQ 5.8 and your latest library. Subscribing to topics works great in a desktop browser such as Chrome. However, in Safari for iOS such as on an iPad, it's able to connect, subscribe to topics, receive messages, but loses the connection after less than a minute. The iPad has the latest iOS version (6.1.3) and Safari is using the rfc-6455 version of websockets.

The error callback produces nothing, but in the debug output, it says "Whoops! Lost connection to ws://localhost:61614/stomp".

Unfortunately I don't have a Mac on hand at the moment, so I can't attach a cable and see the debug output from the iPad within Safari.

It produces the same problem on earlier versions of ActiveMQ too. I don't know if the issue is with your code or ActiveMQ.

kevinpreynolds commented 11 years ago

I configured and ran the browsertests page too just now and Safari on the iPad passed 24 out of 24 tests. Even Chrome on the desktop didn't do that well.

jmesnil commented 11 years ago

you are browsing on the iPad and connecting to ActiveMQ on localhost? I don't understand...

kevinpreynolds commented 11 years ago

Sorry, I changed the real IP address to localhost in the example I posted above. They're on the same network and it really said "Whoops! Lost connection to ws://10.10.1.10:61614/stomp".

higgspa commented 11 years ago

I have seen the "Whoops!" in a few situations. One was fixed in AMQ 5.7 and it was related to using "localhost" so that should not be it. What are your message sizes? If they are large you may want to increase the max size.

Below is an example AMQ configuration:

kevinpreynolds commented 11 years ago

Can you try posting that configuration again? The messages are maybe 1000 characters or less. It will disconnect though even if no incoming messages have been received.

higgspa commented 11 years ago

transportConnector name="websocket" uri="ws://0.0.0.0:61614?websocket.maxTextMessageSize=999999&websocket.maxIdleTime=60000&websocket.bufferSize=32536"

It filtered the XML so I just removed the angle brackets and it went through.

kevinpreynolds commented 11 years ago

I tried that configuration on both 5.7 and 5.8 and got the same results. Still works fine in Chrome on the desktop.

jmesnil commented 11 years ago

I checked and the chat example is working fine on my iPhone and iPad both with the latest iOS release (6.1.3 (10B329). On the server-side, I used the ActiveMQ Apollo 1.5 broker.

I'll close this issue as it's not in the JavaScript client side and let you open one in ActiveMQ issue tracker