wernight / docker-ngrok

An Ngrok v2 container based on wizardapps/ngrok and fnichol/ngrok
https://hub.docker.com/r/wernight/ngrok/
MIT License
456 stars 143 forks source link

Is it possible for this to listen to a port of a local VM? #35

Open iancullinane opened 5 years ago

iancullinane commented 5 years ago

Currently I ngrok the local IP of a vagrant box, and the application port. Everything is fine.

I want to put ngrok in a container for security and I saw this. Is the --link flag required? I tried to run without it and use the command I always use (ngrok http 172.17..x.x:some-port) and it starts but the request doesn't go from local ngrok container to vagrant address. Not sure if this is already a use case and I am not understanding correctly, or if it would require more troubleshooting on my end.

senorgeneral commented 5 years ago

Currently I run an Ngrok Docker on Unraid pointing to the :32400 port on my Plex docker. All hosted on the same machine. You need to point to the IP of your VM as other machines in your network would access it. 192.168.... not the virtual network IPs of 172.....

No --link was required. Just NGROK_PORT and NGROK_AUTH. The key is to pass the IP and the Port at the same time to the NGROK_PORT variable.

Example: NGROK_PORT = 192.168.2.22:32400

Otherwise you will only be sending localhost:32400 and it just doesn't work.

bekkazy-k commented 2 years ago

docker run --rm -it wernight/ngrok ngrok http host.docker.internal:3000

https://docs.docker.com/desktop/mac/networking/#use-cases-and-workarounds