<?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[Links &amp; Resources]]></title><description><![CDATA[Articles, links, and resources. Share your blog posts here!]]></description><link>http://discuss.colyseus.io/category/3</link><generator>RSS for Node</generator><lastBuildDate>Mon, 20 Apr 2026 12:30:12 GMT</lastBuildDate><atom:link href="http://discuss.colyseus.io/category/3.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 22 Jul 2022 19:01:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Construct 2 porting]]></title><description><![CDATA[<p>this is excellent plugin,</p>
<p>however how can I change the &quot;END POINT&quot; property  ( URL of Colyseus srv) from the C2 script itself,<br />
now url needs to be hard coded through properties dialog which makes it very difficult to run both<br />
debug and release versions of game, there is a need to contact two different servers.</p>
<p>It would be very handy feature to give the server URL as parameter to  Colyseus.Connect( any server name here)<br />
instead of editing xml file by hand:</p>
<p>&lt;instance type=&quot;Colyseus&quot; uid=&quot;3&quot;&gt;<br />
&lt;properties&gt;<br />
&lt;end-point&gt;wss://srvnamehere&lt;/end-point&gt;<br />
&lt;/properties&gt;<br />
&lt;/instance&gt;</p>
]]></description><link>http://discuss.colyseus.io/topic/70/construct-2-porting</link><guid isPermaLink="true">http://discuss.colyseus.io/topic/70/construct-2-porting</guid><dc:creator><![CDATA[tomtom]]></dc:creator><pubDate>Mon, 15 Apr 2019 10:03:39 GMT</pubDate></item><item><title><![CDATA[TypeScript definitions for the client side]]></title><description><![CDATA[<p>Muito obrigado.</p>
<p>I need to switch using webpack + TS yet. I'll use the distribution files for this project.</p>
]]></description><link>http://discuss.colyseus.io/topic/109/typescript-definitions-for-the-client-side</link><guid isPermaLink="true">http://discuss.colyseus.io/topic/109/typescript-definitions-for-the-client-side</guid><dc:creator><![CDATA[Enriqueto]]></dc:creator><pubDate>Tue, 26 Jun 2018 14:46:01 GMT</pubDate></item><item><title><![CDATA[Colyseus Client for Unreal Engine]]></title><description><![CDATA[<p>hi, for now that's no possible to do. <a href="https://github.com/gamestdio/colyseus/issues/16" rel="nofollow">here</a> on github, you can follow the discussion.</p>
]]></description><link>http://discuss.colyseus.io/topic/67/colyseus-client-for-unreal-engine</link><guid isPermaLink="true">http://discuss.colyseus.io/topic/67/colyseus-client-for-unreal-engine</guid><dc:creator><![CDATA[AnubisCode]]></dc:creator><pubDate>Fri, 20 Apr 2018 05:46:07 GMT</pubDate></item><item><title><![CDATA[Colyseus Client]]></title><description><![CDATA[<p>I've just seen your dashboard and it's look pretty good :)</p>
<p>I'll have a look on your code later to see if some feature are redundant.<br />
However, the purpose of the tools seems to be quite different.</p>

Your dashboard looks awesome to monitor and manage rooms and server on backend side.
My client is more like a Postman client. It helps to debug server without having a fully workable game client.

]]></description><link>http://discuss.colyseus.io/topic/66/colyseus-client</link><guid isPermaLink="true">http://discuss.colyseus.io/topic/66/colyseus-client</guid><dc:creator><![CDATA[GuillaumeLe]]></dc:creator><pubDate>Tue, 17 Apr 2018 13:36:10 GMT</pubDate></item><item><title><![CDATA[Generate json-patch events from colyseus state]]></title><description><![CDATA[<p>Generate json-patch events from colyseus state.<br />
<a href="https://www.npmjs.com/package/colyseus-events" rel="nofollow">Read the project description on npm</a></p>
<p>usage example:</p>
<pre><code>import { wireEvents } from 'colyseus-events';
const room: Room&lt;GameState&gt; = await client.joinOrCreate(&quot;game&quot;);
const events = wireEvents(room.state, new EventEmitter());
// `events` will emit json-patch events whenever the room state changes
</code></pre>
]]></description><link>http://discuss.colyseus.io/topic/691/generate-json-patch-events-from-colyseus-state</link><guid isPermaLink="true">http://discuss.colyseus.io/topic/691/generate-json-patch-events-from-colyseus-state</guid><dc:creator><![CDATA[amir-arad]]></dc:creator><pubDate>Fri, 22 Jul 2022 19:01:50 GMT</pubDate></item><item><title><![CDATA[Gist for saving &#x2F; loading game state]]></title><description><![CDATA[<p>usage example:</p>
<pre><code>const saveGameData = new SaveGame(); // make a custom schema for saved games data
... /* add all state objects from your game manager to saveGameData */
const serialized = await schemaToString(saveGameData);
... /* save to file, read from file etc. */
const loadedGameData: SaveGame = await stringToSchema(SaveGame, serialized );
... /* take game state object from loadedGameData into your game manager */
</code></pre>
<p><a href="https://gist.github.com/amir-arad/08ea6c7b1c1e59d5b6776bedca404df2" rel="nofollow">see code in this gist</a></p>
]]></description><link>http://discuss.colyseus.io/topic/690/gist-for-saving-loading-game-state</link><guid isPermaLink="true">http://discuss.colyseus.io/topic/690/gist-for-saving-loading-game-state</guid><dc:creator><![CDATA[amir-arad]]></dc:creator><pubDate>Fri, 22 Jul 2022 18:58:17 GMT</pubDate></item><item><title><![CDATA[Colyseus and wss proxy (to a docker)]]></title><description><![CDATA[<p>Installing Local Certificate Authority for testing purposes.</p>
<p>I wanted to create a proxy from wss to ws connection. But I didn't want to touch my production environment.</p>
<p>So I created a local certificate authority on my local = private computer.</p>
<p>This is how I did this (Oracle Enterprise Linux = CentOS = RedHat - based)</p>
<p>(First start with a root login)</p>
<ul>
<li>vi /etc/yum/repos.d/epel-yum-ol7.repo</li>
</ul>
<pre><code>[ol7_epel]
name=Oracle Linux $releasever EPEL ($basearch)
baseurl=http://yum.oracle.com/repo/OracleLinux/OL7/developer_EPEL/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1
</code></pre>
<ul>
<li>
<p>yum repolist</p>
</li>
<li>
<p>yum -y install easy-rsa</p>
</li>
</ul>
<p>Connect non-root-user</p>
<ul>
<li>
<p>useradd myrsa</p>
</li>
<li>
<p>passwd myrsa</p>
</li>
<li>
<p>su - myrsa</p>
</li>
</ul>
<p>(add user to sudoers)</p>
<ul>
<li>
<p>mkdir ~/easy-rsa</p>
</li>
<li>
<p>ln -s /usr/share/easy-rsa/3/* ~/easy-rsa/</p>
</li>
<li>
<p>chmod 700 ~/easy-rsa</p>
</li>
<li>
<p>cd ~/easy-rsa<br />
*./easyrsa init-pki</p>
</li>
<li>
<p>vi vars</p>
</li>
</ul>
<pre><code>set_var EASYRSA_REQ_COUNTRY    &quot;NL&quot;
set_var EASYRSA_REQ_PROVINCE   &quot;MyProv&quot;
set_var EASYRSA_REQ_CITY       &quot;MyCity&quot;
set_var EASYRSA_REQ_ORG        &quot;MyOrg&quot;
set_var EASYRSA_REQ_EMAIL      &quot;admin@localhost&quot;
set_var EASYRSA_REQ_OU         &quot;Community&quot;
set_var EASYRSA_ALGO           &quot;ec&quot;
set_var EASYRSA_DIGEST         &quot;sha512&quot;
</code></pre>
<ul>
<li>./easyrsa build-ca nopass</li>
</ul>
<pre><code>. . .
Enter New CA Key Passphrase:
Re-Enter New CA Key Passphrase:
. . .
Common Name (eg: your user, host, or server name) [Easy-RSA CA]:

CA creation complete and you may now import and sign cert requests.
Your new CA certificate file for publishing is at:
~/easy-rsa/pki/ca.crt
</code></pre>
<ul>
<li>cat ~/easy-rsa/pki/ca.crt</li>
</ul>
<hr />
<p>Other Server : WebServer  (or the same system : in my case the same system )</p>
<ul>
<li>
<p>vi /tmp/ca.crt<br />
pate data from the ca.crt you created earlier</p>
</li>
<li>
<p>sudo cp /tmp/ca.crt /etc/pki/ca-trust/source/anchors/</p>
</li>
<li>
<p>sudo update-ca-trust</p>
</li>
</ul>
<p>Make private key</p>
<ul>
<li>openssl genrsa -out webserver.key</li>
</ul>
<p>Certificate SIGNING request : CSR</p>
<ul>
<li>openssl req -new -key webserver.key -out webserver.req</li>
</ul>
<p>Verify:</p>
<ul>
<li>
<p>openssl req -in webserver.req -noout -subject</p>
</li>
<li>
<p>cat webserver.req<br />
-----BEGIN CERTIFICATE REQUEST-----<br />
....</p>
</li>
</ul>
<p>Transport this certificate to the ca-server</p>
<ul>
<li>vi /tmp/webserver.req<br />
paste - webserver.req from other server</li>
</ul>
<ul>
<li>cd ~/easy-rsa</li>
<li>./easyrsa import-req /tmp/webserver.req webserver</li>
<li>./easyrsa sign-req server webserver<br />
Enter: Yes</li>
</ul>
<p>Certificate created at: .../webserver.crt</p>
<ul>
<li>cat ~/easy-rsa/pki/issued/webserver.crt</li>
</ul>
<p>-----BEGIN CERTIFICATE-----</p>
<p>Take this certifcate to the webserver</p>
<ul>
<li>vi /tmp/webserver_ca.crt<br />
Paste certificate</li>
</ul>
<p>WebServer (root)</p>
<ul>
<li>cp /tmp/webserver_ca.crt /etc/pki/tls/certs/webserver_ca.crt</li>
<li>cp webserver.key /etc/pki/tls/private/webserver.key</li>
<li>chmod 600 /etc/pki/tls/private/webserver.key</li>
</ul>
<ul>
<li>yum -y install httpd mod_ssl mod_dav_svn ssl proxy proxy_http proxy_html proxy_wstunne</li>
<li>vi /etc/httpd/conf.d/ssl.conf</li>
</ul>
<p>SSLCertificateFile /etc/pki/tls/certs/webserver_ca.crt<br />
SSLCertificateKeyFile /etc/pki/tls/private/webserver.key<br />
SSLCACertificateFile /etc/pki/tls/certs/ca-bundle.crt</p>
<p>service httpd restart</p>
<p>Importing CA in Browser</p>
<p>In order for the client to trust the server it should also trust the CA that made the key.</p>
<p>Generate a key you can import in a browser:</p>
<ul>
<li>cd /home/myrsa/easy-rsa</li>
<li>openssl pkcs12 -export -in pki/ca.crt -inkey  pki/private/ca.key -out browser.pfx</li>
</ul>
<hr />
<p>Browser / Client</p>
<p>Client computer:<br />
c&gt; pscp root@ca_server:/home/myrsa/easy-rsa/browser.pfx Downloads</p>
<p>Add the name 'webserver' to your host-resolver:</p>
<p>C&gt; notepad c:\windows\system32\drivers\etc\hosts<br />
192.168.0.12 webserver</p>
<p>Open browser</p>
<ul>
<li>chrome://settings/security?search=certificat<br />
Go to certificate management and import the PFX into the Trusted ROOT CERTIFICATES</li>
</ul>
<p>You can now make a secure connection to the webserver:</p>
<p><a href="https://webserver" rel="nofollow">https://webserver</a></p>
<p><strong>Proxy Forward</strong></p>
<ul>
<li>vi /etc/httpd/conf.d/ssl.conf<br />
Add below  in the file :</li>
</ul>
<p>To make sure that all non-browser traffic goes to specific port I open up the 8567 port instead of 443</p>
<pre><code>  &lt;VirtualHost *:8567&gt;
    
    SSLEngine On
    SSLCertificateFile /etc/pki/tls/certs/webserver_ca.crt
    SSLCertificateKeyFile /etc/pki/tls/private/webserver.key
    SSLCACertificateFile /etc/pki/tls/certs/ca-bundle.crt

     RewriteEngine On

    RewriteCond %{HTTP:Upgrade} =websocket [NC]
        # Port 3567 is where the docker is listening for
    RewriteRule ^/(.*)    ws://0.0.0.0:3567/$1 [P,L]

  &lt;/VirtualHost&gt;
</code></pre>
<p>My docker is started like this:</p>
<ul>
<li>docker run --name=col -h col --dns=8.8.8.8 -p 3567:3567  -v /home/root:/home/extern/ -t -d oel /bin/bash</li>
</ul>
<p>Port forward trafic comming from 3567 is going inside the docker where colyseus is listening on 3567 as well.</p>
<p>Firewall is completely open on my private server.<br />
This should never be done for global servers. But for global servers you really need a non-self-signed certificate.</p>
<p>You now have a secure connection to the server and it will proxy the stream to the docker. Inside the docker (colyseus-code) nothing has to be altered!</p>
]]></description><link>http://discuss.colyseus.io/topic/461/colyseus-and-wss-proxy-to-a-docker</link><guid isPermaLink="true">http://discuss.colyseus.io/topic/461/colyseus-and-wss-proxy-to-a-docker</guid><dc:creator><![CDATA[mdotedot]]></dc:creator><pubDate>Fri, 30 Apr 2021 15:48:18 GMT</pubDate></item><item><title><![CDATA[Using HTTPS and WSS with an Apache proxy]]></title><description><![CDATA[<p>Hi all,</p>
<p>I'm running a NodeJS server on Ubuntu 18.04 behind an apache proxy.</p>
<p>For anyone looking for the config for an apache proxy look no further :)<br />
After a lot of time spent searching for a solution, this is the solution I found.</p>
<p>*Note:<br />
You'll need the following apache modules enabled:</p>
<ul>
<li>ssl</li>
<li>proxy</li>
<li>proxy_http</li>
<li>proxy_html</li>
<li>proxy_wstunnel</li>
</ul>
<p>(or just run 'sudo a2enmod ssl proxy proxy_http proxy_html proxy_wstunnel')</p>
<pre><code class="language-apache">&lt;VirtualHost *:80&gt;

    ServerName servername.xyz
        
    #redirect all requests received from port 80 to the HTTPS variant (force ssl)
    RewriteEngine On
    RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]

&lt;/VirtualHost&gt;

&lt;VirtualHost *:443&gt;

    ServerName servername.xyz
        
    #enable SSL
    SSLEngine On
    SSLCertificateFile          /PATH/TO/CERT/FILE    (note: i'm using the fullchain.pem file which is generated using LetsEncrypt's certbot cli)
    SSLCertificateKeyFile       /PATH/TO/PRIVATE/KEY/FILE

    #setup the proxy to forward websocket requests properly (note: this proxy automatically converts the secure websocket (wss)
    #to a normal websocket and vice versa, so there's no need to change the colyseus library or the server for that matter)
    RewriteEngine On
    RewriteCond %{HTTP:UPGRADE} ^WebSocket$           [NC,OR]
    RewriteCond %{HTTP:CONNECTION} ^Upgrade$          [NC]
    RewriteRule .* ws://127.0.0.1:APP-PORT-HERE%{REQUEST_URI}  [P,QSA,L]

    #setup the proxy to forward all https requests to http backend (also automatic conversion from https to http and vice versa)
    ProxyPass &quot;/&quot; &quot;http://127.0.0.1:APP-PORT-HERE/&quot;
    ProxyPassReverse &quot;/&quot; &quot;http://127.0.0.1:APP-PORT-HERE/&quot;

&lt;/VirtualHost&gt;
</code></pre>
<p>I hope this post can be of any help :)</p>
]]></description><link>http://discuss.colyseus.io/topic/304/using-https-and-wss-with-an-apache-proxy</link><guid isPermaLink="true">http://discuss.colyseus.io/topic/304/using-https-and-wss-with-an-apache-proxy</guid><dc:creator><![CDATA[TomKleine]]></dc:creator><pubDate>Sun, 01 Dec 2019 20:05:01 GMT</pubDate></item><item><title><![CDATA[Plane P2JS tiledmap demo - How to use Phaser 3 physics engine on the server]]></title><description><![CDATA[<p>Hi everyone,</p>
<p>A few months ago I've started my project using Colyseus and Phaser 3:<br />
<a href="https://github.com/damian-pastorini/dwdgame" rel="nofollow">https://github.com/damian-pastorini/dwdgame</a></p>
<p>After hit a few walls and considering it was my first project it took me some time until I was able to get the physics working on the server to avoid cheating.<br />
The way I get it done was using Phaser physics engine P2JS: <a href="https://github.com/schteppe/p2.js" rel="nofollow">https://github.com/schteppe/p2.js</a><br />
Doing this I was able to avoid an overhead of modules and stuff required to run a headless Phaser.</p>
<p>Here I bring for you a small example of how to recreate a Tiledmap using P2JS:<br />
<a href="https://github.com/damian-pastorini/p2js-tiledmap-demo" rel="nofollow">https://github.com/damian-pastorini/p2js-tiledmap-demo</a></p>
<p>I'm still finishing the dwdgame version 1.2.6 in which this demo will be fully integrated.</p>
<p>Hope you like it, and please I would love to get any feedback!</p>
]]></description><link>http://discuss.colyseus.io/topic/226/plane-p2js-tiledmap-demo-how-to-use-phaser-3-physics-engine-on-the-server</link><guid isPermaLink="true">http://discuss.colyseus.io/topic/226/plane-p2js-tiledmap-demo-how-to-use-phaser-3-physics-engine-on-the-server</guid><dc:creator><![CDATA[dpastorini]]></dc:creator><pubDate>Thu, 21 Mar 2019 22:37:47 GMT</pubDate></item><item><title><![CDATA[Beginner learning to use Colyseus]]></title><description><![CDATA[<p>Summary:<br />
Learning to use Colyseus as a beginner.<br />
Things I had considered when I started and trying out room handlers, specifically requestJoin(option) function.<br />
<a href="https://codefalls.wordpress.com/2017/10/28/learning-colyseus-0-5-0/" rel="nofollow">https://codefalls.wordpress.com/2017/10/28/learning-colyseus-0-5-0/</a></p>
]]></description><link>http://discuss.colyseus.io/topic/8/beginner-learning-to-use-colyseus</link><guid isPermaLink="true">http://discuss.colyseus.io/topic/8/beginner-learning-to-use-colyseus</guid><dc:creator><![CDATA[shophk]]></dc:creator><pubDate>Sat, 28 Oct 2017 14:37:51 GMT</pubDate></item></channel></rss>