通过我们的服务器代理请求时如何为用户区域获取最近的 Xirsys STUN/TURN 服务器
How to get closest Xirsys STUN/TURN servers for a user's region when proxying the request through our server
Xirsys 文档说,为了安全起见,您应该始终通过 Web 服务器代理对 STUN/TURN 服务器列表的请求,而不是直接从客户端向 Xirsys 发出请求。这是有道理的。但他们还表示 "In order to really benefit from all the global locations, you can use the global.xirsys.net path in your calls. The global.xirsys.net path will auto detect the user's location and return the closest available geographic region so the user gets the fastest responses possible."
但是,我们的网络服务器托管在一个地区。我们的 Web 服务器正在向 global.xirsys.net 发出请求。所以 xirsys 总是 returns 离我们的服务器 最近的区域 ,而不是 离用户 .
最近的区域
我能否以某种方式修改对 Xirsys 的请求以提供用户的 IP 地址? (大概这就是它计算出用户区域的方式......)或者除了我们自己进行 IP > 区域查找并将我们的请求发送到最近的 Xirsys 区域服务器之外,是否还有其他方法可以工作?
参考文献:
xirsys-examples-v3 (https://github.com/xirsys/xirsys-examples-v3) now supports geolocation via maxmind (https://github.com/runk/node-maxmind). By default, the xirsys-examples-v3 app uses the free databases found in geolite2 (https://github.com/runk/node-geolite2) but we strongly recommend "Using GeoIP Update"(https://dev.maxmind.com/geoip/geoipupdate/#Using_GeoIP_Update) 然后覆盖在 default.json 配置文件中找到的 maxmind 数据库路径。
Xirsys 文档说,为了安全起见,您应该始终通过 Web 服务器代理对 STUN/TURN 服务器列表的请求,而不是直接从客户端向 Xirsys 发出请求。这是有道理的。但他们还表示 "In order to really benefit from all the global locations, you can use the global.xirsys.net path in your calls. The global.xirsys.net path will auto detect the user's location and return the closest available geographic region so the user gets the fastest responses possible."
但是,我们的网络服务器托管在一个地区。我们的 Web 服务器正在向 global.xirsys.net 发出请求。所以 xirsys 总是 returns 离我们的服务器 最近的区域 ,而不是 离用户 .
最近的区域我能否以某种方式修改对 Xirsys 的请求以提供用户的 IP 地址? (大概这就是它计算出用户区域的方式......)或者除了我们自己进行 IP > 区域查找并将我们的请求发送到最近的 Xirsys 区域服务器之外,是否还有其他方法可以工作?
参考文献:
xirsys-examples-v3 (https://github.com/xirsys/xirsys-examples-v3) now supports geolocation via maxmind (https://github.com/runk/node-maxmind). By default, the xirsys-examples-v3 app uses the free databases found in geolite2 (https://github.com/runk/node-geolite2) but we strongly recommend "Using GeoIP Update"(https://dev.maxmind.com/geoip/geoipupdate/#Using_GeoIP_Update) 然后覆盖在 default.json 配置文件中找到的 maxmind 数据库路径。