美文网首页
Netty Socketio解决Access-Control-A

Netty Socketio解决Access-Control-A

作者: 奇乞祈兴 | 来源:发表于2018-04-17 13:49 被阅读0次
node.js服务器:
io.set('transports', ['websocket', 'xhr-polling', 'jsonp-polling', 'htmlfile', 'flashsocket']);
io.set('origins', '*:*');
JAVA服务器:
Configuration config = new Configuration();
config.setTransports(Transport.POLLING, Transport.WEBSOCKET);
config.setOrigin(":*:");
客户端:
var socket =  io.connect('http://127.0.0.1:8081',{transports:['websocket','xhr-polling','jsonp-polling']});

相关文章

网友评论

      本文标题:Netty Socketio解决Access-Control-A

      本文链接:https://www.haomeiwen.com/subject/jaeukftx.html