teleportxr 1.0.29 → 1.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/signaling.js +11 -1
package/package.json
CHANGED
package/signaling.js
CHANGED
|
@@ -189,9 +189,19 @@ function OnWebSocket(ws, req) {
|
|
|
189
189
|
// This allows us to auto-detect the server's public address
|
|
190
190
|
if (!clientHostHeader && req.headers) {
|
|
191
191
|
// Try to get the host from headers, preferring X-Forwarded-Host (for reverse proxies)
|
|
192
|
-
|
|
192
|
+
const xForwardedHost = req.headers['x-forwarded-host'];
|
|
193
|
+
const hostHeader = req.headers['host'];
|
|
194
|
+
clientHostHeader = xForwardedHost || hostHeader || '';
|
|
193
195
|
if (clientHostHeader) {
|
|
194
196
|
console.log("Auto-detected resource server host from client connection: " + clientHostHeader);
|
|
197
|
+
if (xForwardedHost) {
|
|
198
|
+
console.log(" (from X-Forwarded-Host: " + xForwardedHost + ")");
|
|
199
|
+
} else if (hostHeader) {
|
|
200
|
+
console.log(" (from Host: " + hostHeader + ")");
|
|
201
|
+
}
|
|
202
|
+
} else {
|
|
203
|
+
console.log("WARNING: Could not auto-detect host from request headers");
|
|
204
|
+
console.log(" Available headers: " + JSON.stringify(req.headers));
|
|
195
205
|
}
|
|
196
206
|
}
|
|
197
207
|
|