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

plz,I want to use both socket.io and http.what can I do? #133

Closed
cavacn opened this issue Jul 17, 2014 · 15 comments
Closed

plz,I want to use both socket.io and http.what can I do? #133

cavacn opened this issue Jul 17, 2014 · 15 comments
Assignees
Milestone

Comments

@cavacn
Copy link

cavacn commented Jul 17, 2014

I would like to have both socket.io and http service

@mrniko
Copy link
Owner

mrniko commented Jul 17, 2014

What?

@cavacn cavacn changed the title plz plz,I want to user both socket.io and http.what can I do? Jul 17, 2014
@cavacn
Copy link
Author

cavacn commented Jul 17, 2014

I would like to have both socket.io and http service,what should we do?

@cavacn cavacn changed the title plz,I want to user both socket.io and http.what can I do? plz,I want to use both socket.io and http.what can I do? Jul 17, 2014
@mrniko
Copy link
Owner

mrniko commented Jul 17, 2014

And which problems you have encountered?

@cavacn
Copy link
Author

cavacn commented Jul 17, 2014

@mrniko I am doing the flash game in client using Flash Player(version 11.1), and the flash communication mostly with Netty-SocketIO at port 8800.
But for the Adobe Flash Player security policy, it need firstly send a http based request to the same server:port.
So, the Netty-SocketIO server need to deal both the WebSocket based request and also the http-based request at the same ip:port.
Is there some suggest from your side or some solutions?

Thanks.

@mrniko
Copy link
Owner

mrniko commented Jul 17, 2014

Which version of Netty-SocketIO do you use?

@cavacn
Copy link
Author

cavacn commented Jul 17, 2014

newest

@mrniko
Copy link
Owner

mrniko commented Jul 17, 2014

which socketio client do you use?

@mrniko
Copy link
Owner

mrniko commented Jul 17, 2014

socketio 1.0 is not available for flash as i know

@cavacn
Copy link
Author

cavacn commented Jul 18, 2014

Netty-SocketIO I use 1.6.
the client socketio I use https://github.com/simb/FlashSocket.IO , this.
When , In the same domain.It's OK 。
Then , In the different domain,It's need the cross crossdomain.xml。
Can I start Netty-SocketIO and http service at the same port?

@mrniko
Copy link
Owner

mrniko commented Jul 18, 2014

in case of flashsocket usage, netty-socketio replays by crossdomain.xml first time

@cavacn
Copy link
Author

cavacn commented Jul 18, 2014

But , I visit the crossdomain.xml in the same port , the http state is 400.I can't visit the crossdomain.xml

@pablojr
Copy link

pablojr commented Jul 18, 2014

@cavacn, since netty-socketio library obviously uses Netty as underlying library, you can take advantage of Netty and create an HTTP server in the same Java application you're creating your netty-socketio server, see for example http://netty.io/4.0/xref/io/netty/example/http/file/HttpStaticFileServer.html

And regarding having several services listening to the same port you may want to take a look at http://netty.io/4.0/xref/io/netty/example/portunification/PortUnificationServer.html

@cavacn
Copy link
Author

cavacn commented Jul 21, 2014

@pablojr thank you very much, I try it!!o(∩_∩)o

@mrniko
Copy link
Owner

mrniko commented Jul 30, 2014

With new Configuration.crossDomainPolicy param you don't need to host crossdomain.xml anymore. Just define crossDomainPolicy and this stream content will be sended in response body by first flash-socket request. Commited to '1.6' branch

@mrniko mrniko added this to the 1.6.6 milestone Jul 30, 2014
@mrniko mrniko self-assigned this Jul 30, 2014
@dgolovin-dev
Copy link

configure nginx as proxy (one port for http and ws) and add required headers (crossdomain policy and other)...

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

No branches or pull requests

4 participants