https - Run node.js as secure server and use webRTC when IIS is using port 443? -


i trying use webrtc stream audio client node.js. problem is: webrtc not work on http, https. - iis using port. tried establishing node.js listen port 443:

first attempt: use https.createserver, on port 9001:

node.js script:

var options = {     key: fs.readfilesync('../cert/key.pem'),     cert: fs.readfilesync('../cert/server.crt')  }; var httpsserver = https.createserver(options).listen(443); var server = binaryserver({ server: httpsserver, port: 443 }); 

client script:

client = new binaryclient('ws://example.com:443'); 

i'm getting error in node script, first question is: because port 443 being used iis?

throw er; // unhandled 'error' event ^

error: listen eacces 0.0.0.0:443 @ object.exports._errnoexception (util.js:1018:11) @ exports._exceptionwithhostport (util.js:1041:20) @ server._listen2 (net.js:1249:19)

having error, tried using different port (9001).


second attempt: use https.createserver, on port 9001:

client script:

client = new binaryclient('ws://example.com:9001'); 

when try connect client node.js server on 9001, because site address https://example.com, i'm getting error in client:

mixed content: page @ 'https://example.com/page.aspx' loaded on https, attempted connect insecure websocket endpoint 'ws://example.com:9001/'. request has been blocked; endpoint must available on wss.

because error mentions using wss://, tried following.


third attempt: use wss://, on port 9001:

so, switch client work wss://,

client = new binaryclient('wss://example.com:9001'); 

but then, in client, error:

websocket connection 'wss://example.com:9001/' failed: error in connection establishment: net::err_connection_closed

any ideas how can run node.js server on srcure port, assuming iis uses port 443, , still able connect securly client, , use webrtc ?

chrome allowing gum/webrtc secure origins only, i.e: page url should https & subsequent requests page should secure.

so must use wss:// websocket url

it seems using self signed certificates, allow certificate manually entering url https://example.com:9001 in browser tab.

after opening page should error page, need allow clicking advanced -> proceed.

if page not loaded, u need firewall or ip/dns of server reachable browser.


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -