Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add WAMP to the list of allowed websocket subprotocols. #1101

Closed
wants to merge 1 commit into from
Closed

Add WAMP to the list of allowed websocket subprotocols. #1101

wants to merge 1 commit into from

Conversation

blopker
Copy link
Contributor

@blopker blopker commented May 8, 2013

This request allows libraries like https://github.com/blopker/WAMPlay to use AutobahnJS for websocket RPC/PubSub.

Originally the subprotocol list was null. This tells Netty to reject any header with the "Sec-WebSocket-Protocol" field set. Setting the string to "wamp" allows AutobahnJS to connect to Play without using ugly workarounds. To add further protocols (though I'm not aware of others) just set the string to "wamp,otherprotocol".

@blopker
Copy link
Contributor Author

blopker commented May 8, 2013

Also, I already signed the CLA.

@cloudbees-pull-request-builder

play2-master-PRs #128 SUCCESS
This pull request looks good

@nraychaudhuri
Copy link
Contributor

@jroper what do you think?

@jroper
Copy link
Member

jroper commented May 13, 2013

If it's changed to load the CSV list from configuration, then I think it's ok. But I don't want just one subprotocol hard coded in Play.

@jroper
Copy link
Member

jroper commented May 13, 2013

The configuration key should be something like http.netty.websocket.subprotocols.

@nraychaudhuri
Copy link
Contributor

Good idea.

@blopker
Copy link
Contributor Author

blopker commented May 15, 2013

Where should I add the http.netty.websocket.subprotocols key? I'm not very familiar with Scala.

Once I set the key I imagine I'll put something like Option(System.getProperty("http.netty.websocket.subprotocols")).orElse(null) Right?

@jroper
Copy link
Member

jroper commented May 20, 2013

No, it should come from the Play application.conf configuration file, which is accessible through the play Application object. You can pass this through to this method from PlayDefaultUpstreamHandler, which has a reference to Application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants