A simple web app to make local http server live on the internet without installing any tool on the client side
Have you ever used ngrok
like services, where you can make your localhost web server go online? Guess what!!! It requires installing third party app in your device, which is a hasstle. Also, sometimes, it requires additional configurations. In worst case, the device or platform you're using may not even support it. But, almost every smart device today has a web browser. Here is an app for you to do something similar without the need of installing any additional app. Just open your browser, type the necesssary infos and you're done.
- Make any HTTP/S request and get response as one would do in local server
- No hastle of installing third party tool
- Very simple to use. Open the web page and type your running server's HTTP port
- On screen real time log viewer
- All devices are supported including smart phones as long as it has a web browser
- Binary data supported with no content-size limit as long as your RAM permits
- Partial stream support from server to requester
- Full multi part form data upload support
- Content type json, plain text, xml, markdown, urlencoded fully supported
- Download/Upload progress in developer console
- Authorization supported
- Clickable link on logger
- Real-time chunked file streaming with pause-resume support
- Sub-domain added support for absolute path. Also, react-router support confirmed
- Dynamic, auto-scaled, multi-node clustering support
- HTTP/S only, without TCP support
- No stream support in client side
- Max content-size is limited to your RAM size
- CORS(Cross Origin Resource Sharing) must be enabled on the client localhost server
- Redirect hasn't been implemented yet
- Run your localhost http/s project that your want to be live. (example,
VSCode live server
) - Make sure that you enable CORS. If you cannot enable CORS programmatically for some reason, disable CORS from browser.(
VSCode live server
has this built-in) For chrome, you can do this using:
chrome --incognito --disable-web-security --user-data-dir="/tmp/chrome_dev_temp" --allow-file-access-from-files --disable-site-isolation-trials
- Open your browser and open the link for localhost-tunnel
- Give a username(according to your wish) and PORT number(of the running project, ex. 5500) and click
start tunnel
- Follow the log. If everything goes ok, you will be given a link, where your site is live on the internet.
- Clone the repo, open terminal in the project directory and type:
npm i && npm build && npm run tracker
npm start
- Use a Local DNS. I suggest using
Technitium DNS
and add a local domain according to your preference. Let's assume you have a domaintunnel.me
- Use
nginx
or any web server for reverse-proxy and sub-domain support. Configure it according to the next section (nginx config
). - Open
http://domain_name.ext
in browser. For example,http://tunnel.lan
- Set a username (ex. sony) and HTTP/S port number (ex. 3000) of the running localhost project you want to tunnel
- On the screen, there is a logger. If everything is okay, it will give a clickable link (ex. http://sony.tunnel.lan), where the localhost server is being tunnelled
- Now any request you make at the given address (ex. GET http://sony.tunnel.lan/updates) will be tunnelled to the localhost address (ex. GET http://localhost:3000/updates)
websock.conf
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
domain_name.ext
server {
listen 80;
listen [::]:80;
server_name ~^(?:www\.)?domain_name\.ext$;
## replace domain_name and ext with your own
location / {
proxy_pass http://localhost:5000;
include websock.conf;
}
location /sock {
proxy_pass http://localhost:5000/sock;
include websock.conf;
}
location ~(\.|\/)test {
deny all;
}
}
server {
listen 80;
listen [::]:80;
server_name ~^(?<subdomain>.+)\.domain_name\.ext$;
## replace domain_name and ext with your own
location / {
proxy_pass http://localhost:5000/$subdomain$request_uri;
include websock.conf;
}
}