mashupbots / socko

A Scala web server powered by Netty networking and AKKA processing.
Other
255 stars 51 forks source link

WebSocket not worked at all even in example ChatApp #25

Closed Megaprog closed 12 years ago

Megaprog commented 12 years ago

Hello!

Why in example ChatApp where is no connetion at all? WebSocketHandshakeEvent.authorize() method do nothing in code:

def authorize(subprotocols: String = "", maxFrameSize: Int = 102400) { _isAuthorized = true _authorizedSubprotocols = if (subprotocols == null) "" else subprotocols _maxFrameSize = maxFrameSize }

where it is here some response to client?

veebs commented 12 years ago

Hi

ChatApp requires you to open your browser and navigate to http://localhost:8888/html. It is the browser that initiates the connection.

During websocket setup, handshaking needs to happen.

The authorize() method grants permission to socko to proceed with handshaking.

Once handshaking has finished, processing happens in ChatHandler.

Let me know if you require more info. V

Sent from my iPhone

On 29/06/2012, at 2:04 PM, Megaprogreply@reply.github.com wrote:

Hello!

Why in example ChatApp where is no connetion at all? WebSocketHandshakeEvent.authorize() method do nothing in code:

def authorize(subprotocols: String = "", maxFrameSize: Int = 102400) { _isAuthorized = true _authorizedSubprotocols = if (subprotocols == null) "" else subprotocols _maxFrameSize = maxFrameSize }

where it is here some response to client?


Reply to this email directly or view it on GitHub: https://github.com/mashupbots/socko/issues/25

Megaprog commented 12 years ago

I have "Web Socket closed" message in output TextArea when I open my browser and navigate to http://localhost:8888/html. On the server side method wsHandshake.authorize() is invoked but WebSocket connection not established.

veebs commented 12 years ago

Hi, i've just tried it out again and it is working for me with chrome and firefox; on ubuntu 12.04 and Open JDK 7.

I ran

sbt
compile
project socko-examples
run

I then selected the ChatApp,.

What's your environment?

Megaprog commented 12 years ago

My environments are Windows XP / 7 (64bit) Oracle JDK 7.04 with Crome and FireFox last versions. Result is the same: no WebSocket connection established. On client only onclose event is rised.

veebs commented 12 years ago

Hi

Sorry I don't have that environment to help u debug.

Can u set a break point in authorize() as u did before and step through the code? After exiting the route where u call authorize(), it should take you into socko code that performs the handshake.

You may also try using the browser debugger to see what is closing the connection.

V

Sent from my iPhone

On 02/07/2012, at 2:00 AM, Megaprogreply@reply.github.com wrote:

My environments are Windows XP / 7 (64bit) Oracle JDK 7.04 with Crome and FireFox last versions. Result is the same: no WebSocket connection established. On client only onclose event is rised.


Reply to this email directly or view it on GitHub: https://github.com/mashupbots/socko/issues/25#issuecomment-6696017

Megaprog commented 12 years ago

Sorry, it's my fail because jar hell.

Akka 2.02 includes netty 3.3.0 jar file which used prefer netty 3.5.1 When I removed netty 3.3.0 jar all works ok.

Thank you for response!

veebs commented 12 years ago

Cool. Glad it is all working.

V

Sent from my iPhone

On 02/07/2012, at 3:14 PM, Megaprogreply@reply.github.com wrote:

Sorry, it's my fail because jar hell.

Akka 2.02 includes netty 3.3.0 jar file which used prefer netty 3.5.1 When I removed netty 3.3.0 jar all works ok.

Thank you for response!


Reply to this email directly or view it on GitHub: https://github.com/mashupbots/socko/issues/25#issuecomment-6702686