这是我的设置
服务器
var webrtcServer = new PeerServer({
port: 9000,
path: "/wrtc"
});
Peer 1(在 node-webkit 应用程序中运行)
var peer = new Peer( 'masterName', {
host: 'localhost',
port: 9000,
path: '/wrtc'
});
peer.on( 'connection', function(conn) {
conn.on( 'open', function() {
console.log( "peer connected" ); // This fires as expected
conn.send( "helo" );
});
});
Peer 2(在浏览器中运行)
conn = peer.connect('masterName');
conn.on('open', function(){
console.log( "WebRTC connection open" ); // This fires as expected
});
conn.on('data', function(data) {
debugger;
console.log("data"); // This never hits
});
如果我在 peer.js 中设置断点,则不会收到任何数据。如果我将连接设置为可靠,则没有任何变化。还有什么我可以尝试的吗?