By m73mitchell
I have a Go program (see this gist https://gist.github.com/42a45b3926e733ef7b34) that when I run on my local machine starts a server and handles two routes localhost:8080 and localhost:8080/login
I installed Go on an ubuntu server and am able to run the program, however, when I go to my ip addresss 107.170.18.23:8080 and/or 107.170.18.23:8080/login, my browswer appears to be trying to connect and then I get a message that a page isn’t available
I assumed that my ip address on the remote server was the same as localhost on my local machine, so if I simply run the Go program on my localmachine and can view it in the browser, shouldn’t I be able to do the same on the remote machine?
Is there some other type of configuration I need to set up besides what it says in the tutorial for setting up a Ubuntu server?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
localhost = 127.0.0.1, and is local class meaning it cannot be accessed anywhere but from the machine itself. You need to bind your app to the external ip address to listen for remote requests.
You can test this by typing ‘nslookup localhost’ on your droplet.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.