I am observing a strange behaviour with ngrok on a GCE VM.
I fire up a 'preemptible' VM instance with static external ip, and start ngrok on it normally. I get the URL that maps incoming https request to http on localhost. I am also able to check the tunnel and everything is working perfectly fine. I create a snapshot of the bootable disk attached to this VM. I turn off the VM.
Then I create another GCE VM that has exact same configuration, network settings (with a different static ip of course) etc except that I disable the preemtibility. The bootable disk is also created through the snapshot above, so it is the exact replica of the disk for the preemtible VM above. I start ngrok on this non-preemtible machine. Ngrok doesn't complain anything, it seems to have started a tunnel.
However, the tunnel doesn't work.
Can anyone point me to possibe causes / directions to investigate?
I already tried following with no success:
Logging into ngrok and using ngrok authtoken <token> before starting the tunnel
rewriting the host header: ngrok http -host-header=rewrite localhost:3000
I've tried follow your steps on my test project and found no issues.
Please have a look at my steps below:
create VM instance with network tags http-server and https-server:
create firewall rules to allow HTTP/HTTPS incoming connections:
gcloud compute firewall-rules create default-allow-http --direction=INGRESS --priority=1000 --network=default --action=ALLOW --rules=tcp:80 --source-ranges=0.0.0.0/0 --target-tags=http-server
gcloud compute firewall-rules create default-allow-https --direction=INGRESS --priority=1000 --network=default --action=ALLOW --rules=tcp:443 --source-ranges=0.0.0.0/0 --target-tags=https-server
install ngrok and php:
instance-8:~$ sudo apt update
instance-8:~$ sudo apt install snapd
instance-8:~$ sudo snap install ngrok
instance-8:~$ sudo apt install php7.2-cli
connect ngrok to the account:
instance-8:~$ ngrok authtoken xxxxxxxxxxxxxxxxxxxxxxxgmfHM
start embedded php web-server with a dummy page:
instance-8:~$ php -S localhost:8000
PHP 7.2.24-0ubuntu0.18.04.6 Development Server started at Mon Jul 6 17:19:31 2020
Listening on http://localhost:8000
Document root is /home/username
Press Ctrl-C to quit.
start ngrok:
instance-8:~$ ngrok http -host-header=rewrite localhost:8000
ngrok by #inconshreveable (Ctrl+C to quit)
Session Status online
Account XXX (Plan: Free)
Version 2.3.35
Region United States (us)
Web Interface http://127.0.0.1:4040
Forwarding http://1537504102c2.ngrok.io -> http://localhost:8000
Forwarding https://1537504102c2.ngrok.io -> http://localhost:8000
Connections ttl opn rt1 rt5 p50 p90
2 0 0.03 0.01 0.00 0.00
HTTP Requests
-------------
GET /favicon.ico 404 Not Found
GET / 200 OK
check connection and it works as expected.
create new VM instance based on snapshot of the existed VM instance:
gcloud compute disks snapshot instance-8 --snapshot-names=snapshot-1 --zone=europe-west3-a --storage-location=europe-west3
gcloud compute disks create instance-10 --size=10 --zone=europe-west3-a --source-snapshot=snapshot-1 --type=pd-standard
gcloud compute instances create instance-10 --zone=europe-west3-a --machine-type=e2-medium --tags=http-server,https-server --disk=name=instance-10,device-name=instance-10,mode=rw,boot=yes,auto-delete=yes --reservation-affinity=any
start embedded php web-server with a dummy page:
instance-10:~$ php -S localhost:8000
PHP 7.2.24-0ubuntu0.18.04.6 Development Server started at Mon Jul 6 17:42:59 2020
Listening on http://localhost:8000
Document root is /home/username
Press Ctrl-C to quit.
start ngrok:
instance-10:~$ ngrok http -host-header=rewrite localhost:8000
Your account 'XXX' is limited to 1 simultaneous ngrok client session.
Active ngrok client sessions in region 'us':
- ts_1eK49pNAq8zIKDN2ikKdCvVhwHz (35.XXX.153.XXX)
ERR_NGROK_108
stop ngrok at instance-8 and start it at instance-10:
instance-10:~$ ngrok http -host-header=rewrite localhost:8000
ngrok by #inconshreveable (Ctrl+C to quit)
Session Status online
Account XXX (Plan: Free)
Version 2.3.35
Region United States (us)
Web Interface http://127.0.0.1:4040
Forwarding http://38c2f5d9f673.ngrok.io -> http://localhost:8000
Forwarding https://38c2f5d9f673.ngrok.io -> http://localhost:8000
Connections ttl opn rt1 rt5 p50 p90
4 0 0.34 0.39 0.00 0.00
HTTP Requests
-------------
GET /favicon.ico 404 Not Found
GET / 200 OK
check connection and it works as expected.
I was able to reproduce your issue when I checked connection to the shutted down ngrok at instance-8 using old links while ngrok was running at instance-10:
Tunnel 1537504102c2.ngrok.io not found
I've got the same result was when I checked connection to the shutted down ngrok at instance-10 using old links while ngrok was running at instance-8.
I think in your case it could be some issue at the ngrok side and you should contact them via email contact#ngrok.com.
Related
I have a development installation of Gatsby Doc site running on my EC2 server.
When I run the code on my dev machine it works and I can connect my browser to port 8000 and everything is ok..
On my server i check out my github code and
yarn install
npm run start.
Everything builds correctly and Gatsby it listening on port 8000
From my dev machine when I connect using
X.X.X.X:8000 in my browser i receive
Unable to connect
I have opened the port on 8000 in the firewall and I have tested that it works as expected using:
nc -lv 8000
on the server (where gatsby is going to run) and connect using telnet.
on the server i receive
Listening on [0.0.0.0] (family 0, port 8000)
Connection from 84.232.Y.Y 38552 received!
So it works.
When Gatsby is finished starting i see
You can now view gatsbyjs.org in the browser. ⠀ http://localhost:8000/
⠀
when i enter the web address and port i receive
Unable to connect
again. do I need to start Gatsby in another mode?
Kim
I found out.
I just added -H 0.0.0.0 to the start up command and everything works now.
I'm attempting to get Xdebug connecting to my PhpStorm from an EC2 instance.
I have opened up port 9000 on the security group tied to the EC2 instance.
Prior to opening it up with UDP, I would get:
telnet: connect to address <IP>: Connection refused
telnet: Unable to connect to remote host```
After opening it up, I get:
Trying <IP>... and it just hangs there.
I port forwarded 9020 internally to 9000 externally to see if that would give any different results (since I can't find a setting on the router for simply opening up ports)
My xdebug.ini setting is located at: /etc/php-5.6.d/50-xdebug.ini (yes, very old version of PHP that I have to work with here).
My xdebug.ini contains this:
xdebug.remote_autostart=on
xdebug.remote_enable=on
xdebug.idekey=PHPSTORM
xdebug.remote_connect_back = On
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.remote_mode = req
I'm using PhpStorm, and have it listening on port 9020 now (tried 9000 prior to port forwarding with the same result).
I have the Xdebug browser extension installed and have it set to PHPSTORM.
I have stop on first line turned on, as well as breakpoints just in case.
Xdebug is set to listen.
When I hit the PHP page from my browser, nothing happens. I've had this working dozens of times, but never from an EC2 instance. Any idea what I missed?
Installed harbor on a host. Using plain HTTP protocol.
The IP is 192.168.33.10.
I can login it from harbor server itself:
sudo docker login 192.168.33.10
And can access it from browser:
http://192.168.33.10
But can't login it from other client(Mac, installed docker use it). The error message is:
docker login 192.168.33.10
Username: user1
Password: (my_password)
Error response from daemon: Get https://192.168.33.10/v2/: dial tcp 192.168.33.10:443: getsockopt: connection refused
From Harbor documentation there has this notice:
https://github.com/vmware/harbor/blob/master/docs/installation_guide.md
IMPORTANT: The default installation of Harbor uses HTTP - as such, you will need to add the option --insecure-registry to your client's Docker daemon and restart the Docker service.
Both the harbor host and client host set /etc/docker/daemon.json:
{ "insecure-registries":["192.168.33.10"] }
and restarted docker. However, it not works.
If don't setup harbor under HTTPS protocol now, is there a way to access it from client correctly?
Solution
It's unnecessary to set /etc/docker/daemon.json on client. Mac has another way:
Apply and Restart
There is a related post here: Port mapping in Docker on Mac OSX installed with Docker Toolbox
but it didn't work for me
Get ports for container
docker port 485186e65a5e
8080/tcp -> 0.0.0.0:33360
8088/tcp -> 0.0.0.0:33359
19888/tcp -> 0.0.0.0:33358
50070/tcp -> 0.0.0.0:33357
50075/tcp -> 0.0.0.0:33356
8042/tcp -> 0.0.0.0:33361
Check that someone listens to ports in container
bash-4.1# netstat -alnpt | grep 19888
tcp 0 0 127.0.0.1:19888 0.0.0.0:* LISTEN 1094/java
Do wget in container
bash-4.1# wget 127.0.0.1:19888
--2016-04-11 14:16:54-- http://127.0.0.1:19888/
Connecting to 127.0.0.1:19888... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://127.0.0.1:19888/jobhistory [following]
--2016-04-11 14:16:54-- http://127.0.0.1:19888/jobhistory
Reusing existing connection to 127.0.0.1:19888.
HTTP request sent, awaiting response... 200 OK
Length: 6763 (6.6K) [text/html]
Saving to: `index.html'
100%[================================================================================================================================================================================>] 6,763 --.-K/s in 0s
2016-04-11 14:16:54 (182 MB/s) - `index.html' saved [6763/6763]
Try to access forwarded port from host, no luck... :(((
$docker-machine ip default
192.168.99.100
$ wget 192.168.99.100:33358
--2016-04-11 16:18:04-- http://192.168.99.100:33358/
Connecting to 192.168.99.100:33358... failed: Connection refused.
What do I do wrong?
Omg, desired service started on 127.0.0.1 in container, that is why it wasn't visible from outside world. I've modified service config to start on 0.0.0.0 and now I can access forwarded container port
I had the same problem and was able to fix it by specifying the host that the server within the container uses.
NOTE: when using host below, it means a web server host. When I use host-machine, I mean the main operating system I'm using, (i.e. not a container or a web server, just my laptop as a machine)
The Problem
Running web servers on the container like webpack-dev-server and http-server automatically run the app using a host of http://localhost. Typically you will see that in the output when you start the server. Something like :
Project is running at http://localhost:8080
or
Server available at http://127.0.0.1:8080
On most machines, localhost and 127.0.0.1 are the same thing. This host is not publicly viewable. As a result, your host machine can't see anything, even though it's looking in the right place.
Solution
You should specify a public host when you run the server inside your container.
webpack-dev-server --port 8080 --host 0.0.0.0
or
http-server -p 8080 -a 0.0.0.0
Because the 0.0.0.0 address is viewable to any outside machine, you should be able to see your app working as expected from your host machine.
NOTE: This works for any server, like Python's SimpleHTTPServer, etc. Just look up how to change the host for your chosen server in the documentation
Resources/Nods
(how to run webpack-dev-erver with a publicly accessible host)[How to make the webpack dev server run on port 80 and on 0.0.0.0 to make it publicly accessible?
I have installed wakanda server on an Amazon EC2 server running ubuntu by following this utube video: https://www.youtube.com/watch?v=uSQODnB7wRU .
Now the video is for an older version but I have followed along successfully until I actually launch wakanda on the server. This is what I get in the console:
Welcome to Wakanda Server 10 build 10.187175
Publishing "DefaultSolution" solution
The solution's log file will be stored in the "/home/ubuntu/.Wakanda Server/UserCache/Wakanda Server/DefaultSolution-1882/Logs/" folder
The Administration Web Server cannot listen for connections on port 8080 or secure port 4433 on all IP addresses
You can customize the Administration Web Server's ports with the "--admin-port" and "--admin-ssl-port" options
, then when I try to log into it via the browser it says the connection dropped! Any help would be much appreciated, it seams I need to restrict the IP addresses which can access, but how?
Your wakanda server tried and failed to listen on 8080 and/or 4433
Check the following things:
Are the ports 8080 and/or 4433 used by other processes? (sudo netstat -tapen | grep :8080, if a result is found, then yes another process uses 8080. Check 4433 also)
You may found that wakanda server is already running as a service:
yes you should use this service (create and edit /etc/default/wakanda, add WAKANDA_SOLUTION_AT_STARTUP=your_path and restart with sudo /etc/init.d/wakanda restart)
or to continue starting it manually, stop the service first (sudo /etc/init.d/wakanda stop)
Has the current user the right to listen on those ports? (try running the server with sudo just to check, then use authbind or equivalent)
Can you use alternative ports? (use --admin-port and --admin-ssl-port wakanda server options)
wakanda-server --help will give you the list of options available, especially --solution=VALUE to provide the path to your solution.