inlets / inletsctl

Create inlets servers on the top cloud platforms

Home Page:https://docs.inlets.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add a --rm flag to "inletsctl create" for a temporary tunnel

alexellis opened this issue · comments

We should add a --rm flag to "inletsctl create" for when users need a temporary tunnel.

The use-case would be that I want to share my blog i.e. 127.0.0.1:4000 with a friend or colleague, but I don't want to be billed for the DigitalOcean VM beyond my 1-2 hours of uptime.

I'd run a command similar to docker run --rm which removes the tunnel immediately after I hit control + c or exit.

We'd have something like this, but it'd need to work with inlets-pro too:

OSS:

inletsctl create --rm --upstream http://127.0.0.1:4000

Your IP is: X
Starting "inlets client" now, hit control+c to delete the tunnel.

Pro:

inletsctl create --rm --license $LICENSE --remote-tcp=http://127.0.0.1
Your IP is: X
Starting "inlets-pro client" now, hit control+c to delete the tunnel.

@alexellis I would love to know what do you think the right approach would be?
Including inlets from inletsctl as a binary or including the package in the vendor dir?

For the first attempt you should do nothing and assume that is in the path. At later time we can invoke the existing code which performs a download, if we are unable to locate the binary.

@adamjohnson01 I think I missed your comment here?

@alexellis, I said that I would work on it but then I saw @utsavanand2 said in slack that he was working on it so I removed it.

@adamjohnson01 I would love your feedback on it! Maybe we can collab together? I'll push some changes tonight. We'll see how it works.

@alexellis I've created a check which makes sure inlets or inlets-pro is in /usr/local/bin/

It might be worth keeping all messages rather than deleting any so that we don't clash or duplicate work. Async communication is hard.

@utsavanand2 for the first version, there's probably no need to check that the tool exists at all. Let's keep it simple and get it shipped quickly.

@alexellis, you are right I should have commented instead of removing it. I just didn't want to create confusion about who was doing the work.

@utsavanand2, sure I am happy to help out however I can. :)