r/commandline • u/mladvi • 1d ago
Command Line Interface P2P HTTPS to localhost forwarder in one command (virunx)
I built a one-command tool that puts a local port behind a public HTTPS URL:
npx virunx -p 3000 -s test
=> https://test.run.vishota.com (-s is optional)
Requests arriving at that URL (HTTP(S), WebSockets, SSE) are forwarded to your localhost:3000. Two key points of this solution:
- peer-to-peer as the main way to connect + relay-proxy as an emergency fallback;
- one command to make it work: no auth, all the settings are CLI args.
Main page of the project: https://run.vishota.com/ (free until I stop hosting it)
Use cases I see here:
- opening a dev project from another device;
- showing a project to a friend;
- testing HTTPS-only behavior: Secure cookies, OAuth redirects, camera/geolocation, mixed content;
- putting up a demo for some conference or meeting.
You can use it for more production-related things, but keep in mind that the more relay traffic you burn, the lower your priority in traffic distribution is.
P2P-first architecture is my way to make it actually free at any scale: in p2p mode the server does mostly signaling, and that's pretty cheap on the relay server side.
Built it for myself first, then decided to publish.
What I haven't done yet:
- stress testing (can p2p still work while the proxy is overloaded?);
- disabling relay-side proxying entirely (relay mode: if it works, congratulations, if not — you should try something else; note: in some network configs p2p connection is not possible at all);
- moving the tunnel service to a separate domain to protect my main domain's reputation (the tunnel endpoint can be abused).
I've been already using it for some cases like using my old galaxy a55 behind NAT as a VPS, also I've built it in my other project, agentic coding kanban board (will post about it another time, i guess), as a remote access feature basis, virunx worked pretty well for these cases.
I won't bore you with the deeper technical details here — you can dig in via the links below.
npm: https://www.npmjs.com/package/virunx
Main page: https://run.vishota.com
Any feedback welcome!
Note: code of this utility has been written with an AI assistance
1
u/AutoModerator 1d ago
Every new subreddit post is automatically copied into a comment for preservation.
User: mladvi, Flair:
Command Line Interface, Title: P2P HTTPS to localhost forwarder in one command (virunx)I built a one-command tool that puts a local port behind a public HTTPS URL:
npx virunx -p 3000 -s test=> https://test.run.vishota.com (-s is optional)
Requests arriving at that URL (HTTP(S), WebSockets, SSE) are forwarded to your localhost:3000. Two key points of this solution:
- peer-to-peer as the main way to connect + relay-proxy as an emergency fallback;
- one command to make it work: no auth, all the settings are CLI args.
Main page of the project: https://run.vishota.com/ (free until I stop hosting it)
Use cases I see here:
- opening a dev project from another device;
- showing a project to a friend;
- testing HTTPS-only behavior: Secure cookies, OAuth redirects, camera/geolocation, mixed content;
- putting up a demo for some conference or meeting.
You can use it for more production-related things, but keep in mind that the more relay traffic you burn, the lower your priority in traffic distribution is.
P2P-first architecture is my way to make it actually free at any scale: in p2p mode the server does mostly signaling, and that's pretty cheap on the relay server side.
Built it for myself first, then decided to publish.
What I haven't done yet:
- stress testing (can p2p still work while the proxy is overloaded?);
- disabling relay-side proxying entirely (relay mode: if it works, congratulations, if not — you should try something else; note: in some network configs p2p connection is not possible at all);
- moving the tunnel service to a separate domain to protect my main domain's reputation (the tunnel endpoint can be abused).
I've been already using it for some cases like using my old galaxy a55 behind NAT as a VPS, also I've built it in my other project, agentic coding kanban board (will post about it another time, i guess), as a remote access feature basis, virunx worked pretty well for these cases.
I won't bore you with the deeper technical details here — you can dig in via the links below.
npm: https://www.npmjs.com/package/virunx
Main page: https://run.vishota.com
Any feedback welcome!
Note: code of this utility has been written with an AI assistance
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.