Expose Ngrok Web interface in same LAN - centos

I have some issue to configurate Ngrok.
I have installed the Ngrok on linux CentOS server dedicated (IP 192.168.1.124), it works correctly the tunneling is ok.
My question is: how i can reach the web page on 127.0.0.1:4040 in order to check the traffic on my Ngrok server?
The web interface page is only accessible on the server where ngrok is running, but if this is a linux minimal server (without gui and any type of browser) I can't see it.
is there a way to make it accessible also in LAN?
e.g. I have another client that can reach the IP where ngrok is running but if i put on web browser http:\192.168.1.124:4040 nothing is showing.
I see from netstat that this port is not listening so isn't a firewall problem or other.
Is possible to change config of Ngrok? otherwise are there other possibilities ? do i have to use a reverse proxy or something like?
Any ideas?
thanks for your help,
Luca

Locate your ngrok's config file:
$ ngrok config check
Valid configuration file at /home/youruser/.config/ngrok/ngrok.yml
Add to the config file the following line:
web_addr: 192.168.1.124:4040
In case you want to expose it to all interfaces, you can replace that value with 0.0.0.0:4040

Related

How can I see what http traffic to a localhost in Xcode

I have setup proxyman to see http request/response from my app to a remote host in Xcode.
My question is how can I do that for localhost? I don't see anything in Proxyman when I change my app to talk to a local host. And I don't see anything in the Xcode 's networking' tab either.
Thank you.
Follow the Proxyman's troubleshooting guide for this very problem: https://docs.proxyman.io/troubleshooting/.local-doesnt-appear-in-proxyman
By default, you can see any localhost traffic on Proxyman since the traffic doesn't go through Proxyman Server at port 9090.
To fix it, you should map the localhost to any fake domain in /etc/hosts file
Open /etc/host file with any Text Editor (Vim or Sublime)
Add
127.0.0.1 my-website.dev
or
0.0.0.0 my-website.dev
my-website.dev is a fake domain, you can choose any domain you like
Finally, you can access your localhost by using new fake domain.
http://localhost:3000 -> http://my-website.dev:3000
http://localhost:3000/v1/user -> http://my-website.dev:3000/v1/user
They will appear on Proxyman as usual
You can read a Doc at: https://docs.proxyman.io/troubleshooting/couldnt-see-any-request-from-localhost-server

Unable to access jetty server with local IP address

I have configured jetty-maven-plugin in my eclipse Mars and I can run the server using jetty start and stop goals. I can able to access the website using http://localhost:8080/myapp but not using local IP address(i.e., http://192.168.0.5:8080/myapp) from my own computer or other computers connected in the same network via LAN and Wi-Fi.
As mentioned as a solution in these posts,
how to make jetty server accessible from LAN?
Configuring Jetty to accept connections from all hosts
I configured the server host to 0.0.0.0 from localhost to listen on all hosts. With this setting I can see on server start log,
INFO:oejs.AbstractConnector:Started SelectChannelConnector#0.0.0.0:8080
and it works only on http://localhost:8080 but it's not accessible from http://192.168.0.5:8080.
I also tried running that if the interface is accessible using the Networks Interface Listing as mentioned in this comment. and I got,
Display name: NETGEAR WNA1000M N150 Wireless USB Micro Adapter
Name: wlan4
InetAddress: /192.168.0.5
I also tried turning off my Windows Firewall/antivirus but din't help. My jetty version is <jetty.version>9.3.0.M1</jetty.version> and JDK 1.7. What could be the problem? Any help is appreciated.
McAfee Endpoint Security was the culprit here. It was blocking the requests with IP addresses from my very own computer. Turned off the firewall inside the Antivirus and I was able to access the site with http://192.168.0.5:8080/mysite from the browser and other devices connected through the network.
Sometimes some other program opens your port on external address before you do that with Jetty. It will receive all traffic instead. On Windows you will not know it if you reuse port (that is Jetty's default behavior). Check with netstat -ano what is the IP of the process that is indeed listening on 0.0.0.0:8080. Verify if it is your Jetty process only.
Then try connecting with telnet or netcat and see if you can open the connection and what is the response.

apache camel - deploying with cxfs web service

I'm trying to deploy my camel app which on start is creating a cxfrs endpoint. The url is like this: http://localhost:9876 . When I try to hit this one on a rest client or anywhere within my machine it works. But when I try to access it using my phone or other external devices, I'm not able to connect.
Am I missing something?
TIA
Using localhost will mean it is only accessible to your local machine, using 0.0.0.0 instead should make it publicly accessible.
0.0.0.0 should bind all available network interface on your remote machine, but from your description, somehow it only bind to localhost|127.0.0.1 so only accessible from local machine, could you use
http://external.ip.address:9876/foo/FooService
instead to see if it helps?
Also, you can try to access other network service(for example start a tomcat on remote machine and see if you can access it from your local machine) from that remote machine to see if it works, this can determine if your DNS correct or if there's really no firewall between them.

How to access JBOSS Restful web service using IP and Port

I created a test JBOSS web service and there is only one test method in it. I access this using http://localhost:8070/MyWebService/MyRESTApplication
and it shows the result from the web service. I tried this in both Eclipse and Browser and it works.
But when i want to access this web service using IP address of my system then it shows ERROR message that Page cannot be displayed (in fact browser is not able to find this web service).
I want to access like this http://IPaddress:8070/MyWebService/MyRESTApplication
what should i do so that i can access it using my IP from some computer
You have to start JBoss using :
./run.sh -b [your_IPaddress]
On windows:
start run.bat -b 0.0.0.0
This will tell it to start and bind to all network interfaces. You can also replace 0.0.0.0 with your actual IP if you only want it to bind to that network interface.
I find it easier for debugging to have it come up on all network interfaces because this will work when you are running a virtual machine to debug something like Internet Explorer.
Open your server setting in Eclipse and set Host name as your IP address or 0.0.0.0

Proxy for command line utilities in Win XP

How do I get command line utilities like ping to use the default proxy in Windows XP.
proxycfg -u sets the proxy to the default (IE) proxy alright, but it doesn't seem to be working.
Update: I am behind a proxy and would like a way to check if a site is up or not hence trying to use ping! Also would like a way to telnet (without using Putty) to a specific site and port to check connectivity.
A proxy is usually used for web (HTTP) traffic, ping uses ICMP, which is a completely separate protocol. What, exactly are you trying to do?
So, standard ping doesn't go via an HTTP proxy, as everyone's already mentioned. What you probably want is to tunnel your TCP connections (e.g., HTTP, telnet, ssh) via your HTTP proxy using the CONNECT method. For instance, using netcat (telnet will also work, but netcat's better) you'll do the following:
$ nc yourproxy 3128
CONNECT yourtelnetserver:23 HTTP/1.0
then press enter twice.
There are also tools that can do this for you. Keep in mind that some HTTP proxies are configured to allow CONNECT connections only to certain destinations, for example, to port 443 ony (for TLS/SSL/HTTPS).
Ping doesn't use TCP - it uses ICMP, so using a proxy doesn't really make sense.
Do you have another command line utility in mind?
Your best bet will probably be a command line browser for Windows.
You can try out lynx, which is nearly a full browser, or you can go something simpler and use wget. I would recommend wget myself.
Both programs have some way of configuring a proxy, and the documentation should be the same for both Linux and Windows versions.