add option to just drop PC connections rather than HTTP 500 if they connect to the wrong port

This commit is contained in:
zefie
2022-10-02 01:44:07 -04:00
parent 57b8426231
commit ccd0d02676
2 changed files with 6 additions and 0 deletions

View File

@@ -556,6 +556,11 @@ async function processURL(socket, request_headers) {
socket.minisrv_pc_mode = true;
service_name = verifyServicePort("pc_services", socket);
if (!service_name) {
if (minisrv_config.services.pc_services.drop_connection_on_wrong_port) {
// just close the connection, no fancy error
socket.end();
return;
}
var errpage = wtvshared.doErrorPage(500, null, socket.minisrv_pc_mode);
socket_sessions[socket.id].close_me = true;
sendToClient(socket, errpage[0], errpage[1]);

View File

@@ -133,6 +133,7 @@
"port": 1699,
"servicevault_dir": "http_pc",
"disabled": true,
"drop_connection_on_wrong_port": false,
"allow_https": false,
"force_https": false
}