<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Cant get player&#x27;s ip when use colyseus&#x2F;proxy]]></title><description><![CDATA[<p>I use colyseus/proxy for my game.<br />
If I use this code to get ip. I only get ip of proxy of cloud. Not client's ip.</p>
<pre><code>async onAuth(client: Client, options: any, request: http.IncomingMessage) {
const ip = request.headers['x-forwarded-for'] || request.connection.remoteAddress;
}
</code></pre>
<p>Anyone has same problem ? And how to solve this problem ?</p>
]]></description><link>http://discuss.colyseus.io/topic/442/cant-get-player-s-ip-when-use-colyseus-proxy</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Jul 2026 20:30:23 GMT</lastBuildDate><atom:link href="http://discuss.colyseus.io/topic/442.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 25 Feb 2021 10:41:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Cant get player&#x27;s ip when use colyseus&#x2F;proxy on Thu, 25 Feb 2021 15:42:01 GMT]]></title><description><![CDATA[<p>I use colyseus/proxy for my game.<br />
If I use this code to get ip. I only get ip of proxy of cloud. Not client's ip.</p>
<pre><code>async onAuth(client: Client, options: any, request: http.IncomingMessage) {
const ip = request.headers['x-forwarded-for'] || request.connection.remoteAddress;
}
</code></pre>
<p>Anyone has same problem ? And how to solve this problem ?</p>
]]></description><link>http://discuss.colyseus.io/post/1436</link><guid isPermaLink="true">http://discuss.colyseus.io/post/1436</guid><dc:creator><![CDATA[ttcong194]]></dc:creator><pubDate>Thu, 25 Feb 2021 15:42:01 GMT</pubDate></item><item><title><![CDATA[Reply to Cant get player&#x27;s ip when use colyseus&#x2F;proxy on Invalid Date]]></title><description><![CDATA[<p>Hi <a class="plugin-mentions-user plugin-mentions-a" href="http://discuss.colyseus.io/uid/725">@ttcong194</a>, thanks for pointing out!</p>
<p>Can you upgrade <code>@colyseus/proxy</code> to version <code>0.12.4</code>? I've just pushed a fix for this, now forwarding properly the <code>&quot;x-forwarded-for&quot;</code> header: <a href="https://github.com/colyseus/proxy/commit/7137237311709b47f138607334a4ce4e81c8501d" rel="nofollow">https://github.com/colyseus/proxy/commit/7137237311709b47f138607334a4ce4e81c8501d</a></p>
<p>Please let me know if that works for you! Cheers!</p>
]]></description><link>http://discuss.colyseus.io/post/1437</link><guid isPermaLink="true">http://discuss.colyseus.io/post/1437</guid><dc:creator><![CDATA[endel]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Cant get player&#x27;s ip when use colyseus&#x2F;proxy on Fri, 26 Feb 2021 05:43:32 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://discuss.colyseus.io/uid/1">@endel</a> thanks for replying me.<br />
I update new proxy use this command npm i @colyseus/proxy@latest. And make sure last version is 0.12.4.<br />
But when I check file proxy.js again at /node_modules/@colyseus/proxy/proxy.js, I cant find line req.headers['x-forwarded-for'] = req.connection.remoteAddress;</p>
<pre><code>server.on('upgrade', function (req, socket, head) {
    var proxy = getProxy(req.url);
    if (proxy) {
        proxy.ws(req, socket, head);
    }
    else {
        console.error(&quot;No proxy available!&quot;, processIds);
    }
});
</code></pre>
<p>is that any wrong with me ?</p>
]]></description><link>http://discuss.colyseus.io/post/1438</link><guid isPermaLink="true">http://discuss.colyseus.io/post/1438</guid><dc:creator><![CDATA[ttcong194]]></dc:creator><pubDate>Fri, 26 Feb 2021 05:43:32 GMT</pubDate></item><item><title><![CDATA[Reply to Cant get player&#x27;s ip when use colyseus&#x2F;proxy on Invalid Date]]></title><description><![CDATA[<p>Oops, you're right <a class="plugin-mentions-user plugin-mentions-a" href="http://discuss.colyseus.io/uid/725">@ttcong194</a>, for some reason the pre-publishing script did not run before publishing the NPM package... It has been fixed now on 0.12.5! Sorry about that</p>
]]></description><link>http://discuss.colyseus.io/post/1439</link><guid isPermaLink="true">http://discuss.colyseus.io/post/1439</guid><dc:creator><![CDATA[endel]]></dc:creator><pubDate>Invalid Date</pubDate></item><item><title><![CDATA[Reply to Cant get player&#x27;s ip when use colyseus&#x2F;proxy on Invalid Date]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="http://discuss.colyseus.io/uid/1">@endel</a> . it's done and work for me. thanks for your support. You're so nice.</p>
]]></description><link>http://discuss.colyseus.io/post/1440</link><guid isPermaLink="true">http://discuss.colyseus.io/post/1440</guid><dc:creator><![CDATA[ttcong194]]></dc:creator><pubDate>Invalid Date</pubDate></item></channel></rss>