Do you want to test your local web server over
https without uploading anything to the internet? Here's how you can do it with serveo.net.
1. Run your local server
If you already have a local web server setup properly running you can skip this step.
For demo purposes I will use
http-server, is a simple, zero-configuration command-line http server. This will let me run a local server without any configurations. It's actually very useful.
http-server using npm.
npm install http-server -g
So I created a demo project in my Desktop called serveo-demo containing an index.html that prints Random Code Tips on the screen.
Let's run the demo project. Open a terminal and cd to the folder where your index.html is and type:
Now my website is running in http://localhost:8080.
2. Expose your local server to the internet
Open a new terminal and enter this command:
ssh -R 80:localhost:8080 serveo.net
Make sure that you are using the same port as your local server's port.
Note: Since you are accessing an outside server using ssh, your system will ask to add serveo.net to your ssh's known_hosts. This basically just means that you are trusting this server and that you are adding it to the list of known servers by your system.
yes and press ENTER.
It's that simple. Your local server is now running in serveo's server over https. You will find on the screen what link your server is running. In my case it's https://convoco.server.net.
Congrats! You just exposed your local server to the internet!