teleportxr 1.0.29 → 1.0.31

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/client/client.js CHANGED
@@ -142,6 +142,22 @@ class Client {
142
142
  this.clientDynamicLighting.uid_specular_cubemap_texture_uid=resources.AddTexture(this.scene.specularCubemapPath);
143
143
  }
144
144
  }
145
+
146
+ // Log the setup command for debugging
147
+ console.log("\n===== NODE SERVER SENDING SETUPCOMMAND =====");
148
+ console.log(JSON.stringify({
149
+ type: "SetupCommand",
150
+ clientID: this.clientID,
151
+ backgroundMode: this.setupCommand.BackgroundMode_backgroundMode,
152
+ backgroundTexture: this.setupCommand.uid_backgroundTexture,
153
+ drawDistance: this.setupCommand.float32_draw_distance,
154
+ clientDynamicLighting: {
155
+ diffuse_cubemap_texture_uid: this.clientDynamicLighting.uid_diffuse_cubemap_texture_uid,
156
+ specular_cubemap_texture_uid: this.clientDynamicLighting.uid_specular_cubemap_texture_uid
157
+ }
158
+ }, null, 2));
159
+ console.log("===== END SETUPCOMMAND =====\n");
160
+
145
161
  this.SendCommand(this.setupCommand);
146
162
  }
147
163
  SendCommand(command){
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "name": "teleportxr",
17
17
  "description": "Teleport Spatial Server on node.js",
18
- "version": "1.0.29",
18
+ "version": "1.0.31",
19
19
  "repository": {
20
20
  "type": "git",
21
21
  "url": "git+https://github.com/simul/teleport-nodejs.git"
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
- clientHostHeader = req.headers['x-forwarded-host'] || req.headers['host'] || '';
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