mrniko / netty-socketio

Socket.IO server implemented on Java. Realtime java framework
Apache License 2.0
6.82k stars 1.65k forks source link

关于netty-socketio和socketio-netty的疑问? #241

Closed xuxueli closed 9 years ago

xuxueli commented 9 years ago

前段时间看到另一个类似东西,从googlecode迁移过来的项目,名字为:socketio-netty。 这里和netty-socketio做下对比,并提出疑问,希望得到解答; 第一点:socketio-netty支持socket.io所支持的所有通信通道:WebSocket、Adobe® Flash® Socket、AJAX long polling、AJAX multipart streaming、Forever Iframe、JSONP Polling,更秒的是它可以根据浏览器自动选择合适的通讯通道;这里的netty-socketio貌似只支持AJAX long polling,它可以支持其他通信通道吗? 第二点:socketio-netty兼容各个浏览器,甚至IE6,但是netty-socketio甚至谷歌浏览器都不支持,报异常“No 'Access-Control-Allow-Origin' header is present on the requested resource”,请问可以有解决的方案吗?

ghost commented 9 years ago

在考虑要不要用这个,跨域的问题也会出现,不行就直接用node了。。

mrniko commented 9 years ago

Please speak in english. I don't understand chinese

xuxueli commented 9 years ago

I mean that one similar Socket.IO server named "socketio-netty" come from googlecode, it allows us to use protocols like “WebSocket、Adobe® Flash® Socket、AJAX long polling、AJAX multipart streaming、Forever Iframe、JSONP Polling” to communicate, but "netty-socketio" only support "AJAX long polling"; on the other way, with "socketio-netty", we can use eveay borwser, even IE6, but "netty-socketio" can not work on chrome or IE, and it often throw exception "No 'Access-Control-Allow-Origin' header is present on the requested resource".

Any solutions there?

mrniko commented 9 years ago

starting with socketio 1.x.x version support of Flash socket has been dropped. You may try to use socketio 0.9 it works with netty-socketio 1.6.7. In other words: netty-socketio 1.6.x line for socketio 0.9 netty-socketio 1.7.x line for socketio 1.0+

xuxueli commented 9 years ago

It’s brilliant, i use it with netty-socketio1.7.6 and socketio that i do not know which version yesterday, and that does not work, Just now i change the socketio version to 1.3.x , and then it run on IE and chrome well, and the exception "No 'Access-Control-Allow-Origin' header is present on the requested resource" is gone. Good job! However, can you introduce to me about how netty-socketio work with protocols? thanks! 931591021@qq.com

mrniko commented 9 years ago

Sorry but i don't have any docs about socketio protocol. I just reversed a socketio server nodejs version and make those changes in my lib. That's all

afewnotes commented 8 years ago

@xuxueli I've got the same problem, turns out I used the error package. please confirm you use socket.io-client but not socket.io good luck

sumory commented 8 years ago

@xuxueli i used netty-socketio to build IM service.

you can check this example to see how it works.

server side: SpearServer.java ActionListener.java

client side: index.ejs

xuxueli commented 8 years ago

@sumory @zhang-yuan Thank you very much, I will carefully study