aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-03-28 23:12:19 +0200
committertomsmeding <tom.smeding@gmail.com>2017-03-28 23:12:19 +0200
commit8affdf7fe871c78783d63093cc9006867f67e929 (patch)
tree9a752fbc818554a527f54c55510f9b2d4033f771
parent9ad0dd977b35d20343babc85a432ff90b95473ad (diff)
Fix https
-rw-r--r--webclient/client.html2
-rwxr-xr-xwebsockets/server.js7
2 files changed, 8 insertions, 1 deletions
diff --git a/webclient/client.html b/webclient/client.html
index af790c6..218bc22 100644
--- a/webclient/client.html
+++ b/webclient/client.html
@@ -84,7 +84,7 @@ function reconnect(){
net_callbacks={};
var host=location.hostname||"localhost";
- sock=new WebSocket("ws://"+host+":29546");
+ sock=new WebSocket("wss://"+host+":29546");
updateStatus();
updateRoomList();
sock.addEventListener("message",function(msg){
diff --git a/websockets/server.js b/websockets/server.js
index 67ed6d1..aa349cb 100755
--- a/websockets/server.js
+++ b/websockets/server.js
@@ -20,6 +20,13 @@ if(process.argv.length>=4){
};
}
+if(process.getuid()==0){
+ console.log(`Old uid: ${process.getuid()}, old gid: ${process.getgid()}; setting to nobody...`);
+ process.setgid("nobody");
+ process.setuid("nobody");
+ console.log(`New uid: ${process.getuid()}, new gid: ${process.getgid()}`);
+}
+
let httpsServer,wsServer;
if(httpsConfig){