Commit 820b805e authored by echicken's avatar echicken 🐔
Browse files

If BBS is using HAProxy ([BBS] Options line has HAPROXY_PROTO)

then throw an error if X-Forwarded-For header was not received,
or otherwise do the HAProxy thing upon connecting.
parent a7604c63
...@@ -87,6 +87,14 @@ try { ...@@ -87,6 +87,14 @@ try {
var ClientData = []; var ClientData = [];
var ServerData = []; var ServerData = [];
if (UsingHAProxy()) {
if (FWebSocketHeader['X-Forwarded-For'] !== undefined) {
// Do HAProxy stuff here
} else {
throw new Error('BBS is using HAProxy, but no X-Forwarded-For header present.');
}
}
// Loop while we're still connected on both ends // Loop while we're still connected on both ends
while ((client.socket.is_connected) && (FServerSocket.is_connected)) { while ((client.socket.is_connected) && (FServerSocket.is_connected)) {
// Should we yield or not (default true, but disable if we had line activity) // Should we yield or not (default true, but disable if we had line activity)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment