Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It looks like you are trying to use 2 http ports for your service, and dotCloud supports only 1 out of the box, so you need to let them know you want to have another one by adding a small snippet in your <code>dotcloud.yml</code></p> <p>Here is an example <code>dotcloud.yml</code> that is asking for a second tcp port called <strong>server</strong></p> <pre><code>app: type: nodejs ports: server: tcp config: node_version: v0.8.x </code></pre> <p>Once you add this and push, your server will be given a 2nd TCP port you can use for your server, you just need to find out what port that is by getting the value from your environment file.</p> <p>Here is a snippet that will get your port from the ENV, it will default to 4242 when not there so you can still run locally.</p> <pre><code>var webSocketsServerPort = process.env['PORT_SERVER'] || 4242; </code></pre> <p>If you are wondering how I got the ENV variable name, it is simple. it will be PORT_ and then the uppercase string of the name from the <code>dotcloud.yml</code>. Since I used <strong>server</strong> above it became <strong>PORT_SERVER</strong>, if I used node about it would have been PORT_NODE, so put what you want, but make sure those values match.</p> <p><strong>Client:</strong></p> <p>To find out what port you need to connect to on your client, You would need to go back to your environment variables again. This time you are looking for a variable that looks like this <code>DOTCLOUD_APP_SERVER_PORT</code>. <strong>Important</strong>: <em>Your variable name might be different</em></p> <p>How did I get that envirornment variable name? </p> <p>The name of the variable looks like this <code>DOTCLOUD_{{app_name}}_{{port_name}}_PORT</code> all uppercase. Replace the {{variable}}'s with the info below.</p> <p><code>{{app_name}}</code> = the name of your app from your dotcloud.yml, in the example above it is <code>app</code> <code>{{port_name}}</code> = port name, <code>server</code> in dotcloud.yml example above.</p> <p>To find this you can get it from your apps <code>environment.json</code>, <code>environment.yml</code> files, the shell ENV variables, or log into the dotCloud dashboard, click on your app, and then the Environment tab to see a list of your application variables.</p> <p>If you make those three changes, your problems should go away.</p> <p>If you need more code examples, please check out this github repo that doing something similar as what you are trying to do. </p> <p><a href="https://github.com/3on/node-tcp-on-dotcloud" rel="nofollow">https://github.com/3on/node-tcp-on-dotcloud</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload