How to make ngrok client listen a specific hostname instead of localhost? - ngrok

My yaml config is like this:
yarn:
hostname: "ngrok.xfl.me:810"
remote_port: 810
proto:
tcp: 8088
My purpose is:
Forwarding https://ngrok.xfl.me:810-> 192.168.0.104:8088
But by default, as the config above, ngrok client just listen to 127.0.0.1. So it failed to connect.
How can I make the ngrok client listen to a certain hostname 192.168.0.104 instead of localhost
Thanks a lot!

It was solved with:
yarn:
hostname: "ngrok.xfl.me:810"
remote_port: 810
proto:
tcp: 192.168.0.104:8088

Related

Laravel Homestead Mailhog Error listening on socket: listen tcp 0.0.0.0:1025: bind: address already in use

I am struggling to make MailHog work in my Laravel Homestead VM.
If I browse http://localhost:8025/, the web browser says it can't find it.
Then, in the command line, when executing $ mailhog, I get the following error:
Error listening on socket: listen tcp 0.0.0.0:1025: bind: address
already in use
Moreover, if I execute $ mailhog --invite-jim then I get:
2021/09/13 22:49:22 Using in-memory storage 2021/09/13 22:49:22 [SMTP]
Binding to address: 0.0.0.0:1025 [HTTP] Binding to address:
0.0.0.0:8025 2021/09/13 22:49:22 Serving under http://0.0.0.0:8025/ 2021/09/13 22:49:22 [SMTP] Error listening on socket: listen tcp
0.0.0.0:1025: bind: address already in use
Here is my .env config file
.env
MAIL_MAILER=smtp
MAIL_HOST=localhost
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=reply#app.io
MAIL_FROM_NAME="${APP_NAME}"
Does anyone know or can shed some light how to make MailHog work?
Mailhog web interface is clearly listening at the 8025 port. The localhost or 127.0.0.1 address may not work by default.
Take a look at both the /etc/hosts and Homestead.yml file
$ sudo vim /etc/hosts
$ vim Homestead.yml
Look for the address that Homestead is working on. In this case it's 192.168.10.10 or 192.168.56.56
So now try
http://192.168.10.10:8025 or http://192.168.56.56:8025
And it should be working now

TLJH behind NGINX, make proxy Traefik listen to port on localhost only

I want to put TLJH behind NGIX, I succeeded in that by putting the Traefik port in TLJH on 8080 using sudo tljh-config set to port 8080 and having NGINX doing the SSL part and reverse proxying to port 8080.
Only I can still access TLJH without SSL by :8080 which I want to prevent.
I need to set the Traefik listening port to 127.0.0.1:8080 instead of *:8080.
The traefik.toml cannot be changed directly as it is overwritten, tljh-config should be used.
Only tljh-config does not seem to offer me the possibility of setting the address, only the port.
Adding a python file into the jupyterhub_config.d folder with c.JupyterHub.bind_url = 'http://127.0.0.1' did not do anything (checking traefik.toml after reloading hub and proxy)
Any idea how to make TLJH's Traefik listen to local port 8080 only?
Create a .toml config file for Traefik in /opt/tljh/config/traefik_config.d with the following content:
[entryPoints]
[entryPoints.http]
address = "127.0.0.1:8080"
Reload Traefik config: sudo tljh-config reload proxy
Restart Traefik and JupyterHub:
sudo systemctl stop traefik
sudo systemctl restart jupyterhub (starts Traefik automatically)
Traefik should now listen on 127.0.0.1:8080.
Sources:
https://tljh.jupyter.org/en/latest/topic/escape-hatch.html#extending-traefik-toml
https://doc.traefik.io/traefik/routing/entrypoints/

Websocket doesn't work in server 127.0.0.1:8000

I'm using Gos Web Socket Bundle in Symfony and I try to work in demo they give. I'm very confuse about the port because the it works, if the port is 127.0.0.1:1337 but when I run the server of symfony it generate 127.0.0.1:8000, so I try to add it here'
gos_web_socket:
server:
port: 8000 #The port the socket server will listen on
host: 127.0.0.1 #The host ip to bind to
router:
resources:
- '#AppBundle/Resources/config/pubsub/routing.yml'
and the websocket in javascript
var websocket = WS.connect("ws://127.0.0.1:8000");
When the time I display it in my page. I always get bad request. But If I use WS.connect("ws://127.0.0.1:1337"); it works, and the server I run from symfony is 127.0.0.1:8000. I'll be glad if you explain the reason why I need to use 1337 port than 8000
IMHO the port 8000 is already occupied with some other service. I would be suspicious of PHP builtin server, so check the port which is the server listening on by php bin/console server:status. If the port is 8000, then stop it php bin/console server:stop and start on some other port php bin/console server:start 127.0.0.1:8000 and the websocket shoud then be available on 8000.

How to port forwarding/tunneling TCP on Nginx

I am using nginX
nginx version: nginx/1.4.6 (Ubuntu)
I have an app listening TCP on IPv4 port besides 80.
How I can to proxy/forward from domain on TCP 80 to this port.
What keywords should I find or nginx configurations?
Thanks
I think what you need is reverse proxy
Here is great tutorial how to forward connection from nginx to apache
This tutorial shows how to forward connection from nginx on port 80 to apache on port 8080
There are some options:
You can use ssh-forwarding:
plink <ssh user>#<server_ip> -pw <ssh pass> -L 0.0.0.0:<external port>:<target ip in internal network>:<target port in internal network>
Create VPN by OpenVPN for example
Check here - https://unix.stackexchange.com/questions/290223/how-to-configure-nginx-as-a-reverse-proxy-for-different-port-numbers

How to bind Kibana to multiple host names / IPs

Is there a way to bind Kibana to more than one IP address using kibana's config file: kibana.yml?
Right now, if I modify the line
server.host: "127.0.0.1"
to
server.host: ["127.0.0.1","123.45.67.89"]
which is valid YML, I get an error.
Is there any way to accomplish this from within Kibana or do I need to do it through a proxy/nginx?
Try 0.0.0.0 if you want kibana to be available on real ip and localhost at the same time.
Install ngrok from https://ngrok.com/, then from your command line type:
ngrok http 5601
Ngrok will create a tunnel to the server and provide you with a url from which you can access your kibana UI.
If you need to acceess the ngrok and the 4040 port is closed on the server then do the same
ngrok http 4040

Resources