Multiple port on workspaces

workspace

#1

Hi,

I am trying to use multiple ports on my workspaces but I can’t make it work. I found this doc https://docs.c9.io/docs/multiple-ports but it doesn’t work.

I have tried as well https://github.com/cloud9ide/livereload-example to see if it as working but it didn’t really make it better.

I can’t access 8081…

Can you tell me if this feature was still operational ?


#2

this feature still works, what error do you see when trying to use it?


#3

I can’t access the page anytime I use mycloudAddress:8081

I installed https://github.com/cloud9ide/livereload-example.git => https://multiple-port-cifren.c9users.io/, but it is not working.

I tried as well via apache2 config too, but nothing worked.


#4

Do you have an exemple of cloud projects where it is working ?


#5

it appears there is a regression in connect-livereload which tries to load scripts from 0.0.0.0.
I’ve made a pull request with a fix https://github.com/intesso/connect-livereload/pull/78.
Until it is merged, one workaround is to change /etc/hosts to map $C9-HOSTNAME to 0.0.0.0

echo "0.0.0.0 $C9_HOSTNAME" | sudo tee -a /etc/hosts 

and change the hostname passed to live-reload https://github.com/cloud9ide/livereload-example/blob/c52acd9829fa9a84a9055281e5a37061b2852b23/Gruntfile.js#L11 to $C9_HOSTNAME

    grunt.initConfig({
        connect: {
          all: {
            options:{
              port: 8080,
              hostname: process.env.C9_HOSTNAME,
              livereload: 8081
            }
          }
        },

#6

it is still not working, the project is clean of modifications, I did npm install and npm start with the modification you proposed but I still get “GET http://multiple-port-cifren.c9users.io:8081/livereload.js?snipver=1 net::ERR_CONNECTION_TIMED_OUT”

Here https://preview.c9users.io/cifren/multiple_port/
Also I added a symlink for /etc/hosts (hosts, hosts.txt) into the project (but the preview is not working correctly somehow) so I did copy the file.


#7

this looks like an issue with you firewall or proxy settings


here’s what i see when opening http://multiple-port-cifren.c9users.io:8081/livereload.js?snipver=1


#8

Yes I see it on my phone but not on my computer… You are right my network configuration seems to be the cause of allt that… And I don’t see why only this address is blocked, I have usually no issue

I’ll try to find out


#9

Sorry for that question, I didn’t know we didn’t have access to extern port address…

Thank you for your help, at least you found a regression :slight_smile:


#10

To enable port 8081 for http traffic, you need to edit the /etc/services to update the port setting from “tproxy” to “http-alt”. See my post here.