-
My server has an SSL certificate, and the domain works fine with https. I ran "npm install peer", and then ran this javascript:
It worked, but only under http, and if secure:false. This URL returned the correct JSON: I then removed the 'port 9000' PeerJS server, and ran this javascript so it would hopefully work with secure:true:
This did not work. The following URL returned a blank directory, and no JSON: My server is running CentOS v. 7.8 64 bit, and it uses httpd. Let me know if it will be easier to configure a port that is not "well-known" (i.e. not 443) to use for https communication with the PeerJS Server, so I can set "secure: true" in the client script. |
Beta Was this translation helpful? Give feedback.
Replies: 0 comments 3 replies
-
hey did you able to use it on any other server other than localhost ? |
Beta Was this translation helpful? Give feedback.
-
This could be because ports below 1024 require superuser access. Perhaps try running the node server as superuser and see if it works? Since running node as superuser is bad practice, you can configure firewalld / iptables to forward packets from port 443 to 9000. That way, you can run node on port 9000 without superuser and receive all packets that are sent to port 443 (for SSL). |
Beta Was this translation helpful? Give feedback.
-
I don't have this problem with either port configuration of 443 or 4430 for https. But I have another error: and with port 443: websocket.js:88 WebSocket connection to 'wss://localhost/socket.io/?EIO=4&transport=websocket&sid=GIzVOZeoSyroFUPCAAAA' failed: I will open an issue with it and list the code that doesn't have this error, may be it will help you there. |
Beta Was this translation helpful? Give feedback.
This could be because ports below 1024 require superuser access. Perhaps try running the node server as superuser and see if it works?
Since running node as superuser is bad practice, you can configure firewalld / iptables to forward packets from port 443 to 9000. That way, you can run node on port 9000 without superuser and receive all packets that are sent to port 443 (for SSL).