Allowing other computers access localhost

I developed locally OSM frontend following https://github.com/GIScience/openrouteservice-app and can access it through localhost:3005 but I can’t connect to it through other machine in same Wifi through IP:3005
What should I do to allow connections from other machines ?

@caduguedess,

You can try to us Node 13 (see Linking frontend with backend answer).

Best regards.

Hi @amandus,

The answer at Linking frontend with backend didn’t allowed connections from other computers to the frontend.
For some reason I can connect to the backend.
Browsering IP:8080/ors/health returns the status “ready”
But frontend still unavailable
Browsering IP:3005 refuses connection.
Maybe there is some part of the frontend code that binds connections from localhost only.

Hey @caduguedess,

Are you using Node 13?

Keep the ngconstant local targets as they were, and try only changing the following line

using host_IP:8080.

When you are doing requests to the local targets (e.g. localhost:3005/ors/v2/directions) the frontend will replace localhost:3005/ors internally with host_IP:8080.

I’m not sure yet if this will work for a backend on a different server.
But you can give it a try.

Best regards

Yes. Upgraded through nvm with nvm install v13.14.0 and node -v returns v13.14.0

I tried editing that line, I tried IP_address:8080 and IP_address:8082, but it makes the directions stop working in the host machine. Changing ngconstant local targets back as they were drives me back to the previous problem.

Hmm tough one…

I can investigate this further tomorrow.
You might have to look into building the frontend in production mode with your ip settings and serve it using apache. That’s how we do it for our website.
Maybe some configurations there might help.

Best regards

Actually changing that line (216) wasn’t the cause that caused the effect of directions stop working, the ngconstant local target (line 275) was the real cause. But anyway the problem persists.

Best regards.

I managed to do it by changing the hostname to the host IP.

Best regards.

@caduguedess

Thank you for investigating this.

Great it worked!

Could you give a bit more info on where exactly you changed the hostname to the host IP(your server running the ors backend i suppose)?

Just to have closure on this issue.

Best regards

Sure.

In hostname value, where is “localhost” I changed to the actual host IP.
Gruntfile.js line 195 if you start the client with grunt ors
Gruntfile.js line 224 if you start the client with grunt ors_local
Or just change both.

Best regards.

1 Like