-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a8f119e
commit 30f98ad
Showing
3 changed files
with
91 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) [2019] [Mário Carneiro] | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,33 @@ | ||
# tunnelize | ||
|
||
Exposes HTTP services bound to local ports, common in web development environments, | ||
to make them accessible on the internet through a remote server, like a cheap vps | ||
that costs you 2$. | ||
Makes HTTP services bound to local ports, common in web development environments accessible on the internet through a remote server, like a cheap vps that costs you 2$ per month. This allows you to expose your server so that your web site or service can be accessed by colleagues, or receive webhook calls. Essentially, an open-soruce self-hosted alternative to services like ngrok and serveo which have limited free usage. | ||
|
||
Essentially, a self-hosted alternative to services like ngrok and serveo which have | ||
limited free usage. | ||
tunnelize runs an instance of Caddy server on the remote server and uses the reverse port-forwarding feature of the OpenSSH SSH Client to pipe connections from caddy to your locally-running service. | ||
|
||
tunnelize runs an instance of Caddyproxy on the remote server and uses the reverse | ||
port-forwarding feature of the OpenSSH SSH Client to pipe connections from | ||
Caddyproxy to your locally-running service. | ||
Thanks to Caddy server's awesome TLS features, certificate generation is done automatically through Let's Encrypt. You can specify the email address that will be present in the TLS certificate, although this is optional. | ||
|
||
Thanks to Caddyproxy's awesome TLS features, certificate generation is done | ||
automatically through Let's Encrypt. You can specify the email address that will | ||
be present in the TLS certificate, although this is optional. | ||
## Usage | ||
|
||
`tunnelize [-e|--tls-email=email] user@host <expr> [<expr>] ...` | ||
|
||
## 💩 | ||
As this is still a work in progress, it is still not as consumable as I want it to be. | ||
It works, but it still lacks instructions and a provisioning feature to install Caddy | ||
and configure the VPS server. | ||
`<expr>` is of the form: `<local_url>@<remote_vhost>` | ||
|
||
``` | ||
tunnelize --tls-email me@myhost.com myuser@myhost.com \ | ||
localhost:8080@frontend.expose.myhost.com \ | ||
localhost:3000@backend.expose.myhost.com | ||
``` | ||
|
||
`tunnelize` will have Caddy pipe connections from the given remote host to the local running service bound to localhost:6000. The remote host will listen on https and http (which redirects to https). The https certificate will be associated with the given email address. | ||
|
||
## Setting up the remote server | ||
|
||
The remote server needs to have Caddy server installed on it, available through the caddy command. See the caddy server website on https://caddyserver.com/ for installation instructions. As of the time of writing, this is a manual process. | ||
|
||
The caddy command will also need the special capability to bind to ports 80 and 443, unless you want to run the remote server as root, which is generally not advisable. This can be done via the following command, as root: | ||
|
||
``` | ||
# setcap 'cap_net_bind_service=+ep' /usr/local/bin/caddy | ||
``` | ||
|
||
Please mind that the location of the caddy command on your system may vary. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters