I have mqtt broker by ip
mqtt://xxx.xxx.xxx.xxx:8888/
I have a web site
http://mywebsite.com/
Now, I want to make like this
mqtt://mywebsite.com:8888/
If it would be like this still can:
mqtt://iot.publicwebsite.com:8888/ FORWARDFROM-> http://localhost:8888/
OR
mqtt://iot.publicwebsite.com:8888/ FORWARDFROM-> http://xxx.xxx.xxx.xxx:8888/
Depending on if you are using Native MQTT or MQTT over Websockers you have 2 choices
Set up port forwarding on your public facing machine. This means configuring the firewall to take any traffic that arrives on port 8888 and forwarding it to the broker machine and doing the reverse with any response traffic. Assuming you are on Windows then you would use the netsh command. See this question for details. This should work for both Native MQTT and MQTT over Websockets. If you are already using port forwarding from your router to the machine running ISS then you need to set up the port forwarding to the broker in the router, not the Windows machine.
If you are using MQTT over Websockets then you can configure ISS to act as a reverse proxy. This question explains how to do that.
Related
I have started my Node.js express server running on port 3000 and it works on my local computer the server is running on. Then I have forwarded the port 3000 to the IPv4 adress of my computer in my router but I still cannot connect to the server on other devices.
HAs it something to do with the protocol? Do you know why it doesn't work.
To connect to a server on your own local LAN, you need the following things:
The local IP address of the server. It would typically be something like 192.168.1.x, but in some cases it might be of the form 10.0.0.x.
You need to make sure the computer the server itself is on does not have any local firewall that is blocking incoming http connections. On Windows 10, there is a local firewall that by default blocks incoming http requests so you would have to enable incoming http requests on the desired port in that firewall configuration.
You can then connect to that server from somewhere else on your local network with a URL of the form http://192.168.1.x:3000/ where the 192.168.1.x is the actual local IP address of your server computer and the 3000 is the port the server is running on.
You need to make sure your other devices are actually ON your local network. For example, if it's a phone, you need to make sure it's actually connected to your local network via WiFi and not connected to the visitor's connection that can only reach the internet, not your local network.
You do not need to do any port forwarding in your router. That's something that would be done when connecting to your server from outside your network (like from the internet). I that case, you'd have to connect to your public IP address and have that safely port forwarded to your server. But, since you said you're trying to connect to the server from within your LAN, you don't need any port forwarding on your external firewall.
Where I work we have a cloudfoundry server that provides RabbitMQ as a service. When I configure this service and try to connect using amqplib via (localhost, 127.0.0.1, etc) it doesn't connect. When I look at the Java project, it never configures an IP and seems to connect natively through a driver or something (using Spring).
How would I connect using amqplib without an IP? Should I use another node lib instead?
You can make a connection without setting the hostname but then the hostname is set as "localhost" as described in the documentation.
If your RabbitMQ is on a remote server you must provide
a remote IP address
port (if it is different from the default 5672)
username and password of not default user as mentioned here
You may not be able to make a connection due to closed port on the remote server is closed, check it via telnet
I have an IoT client that is connected to a server via wifi. I want to force all communication of the IoT client to go to the server first. Right now, I am connecting the 2 via socket io but when i run a http request code on the IoT to google, the device does not communicate through the server but straight to google. How do I prevent this. Do i change the wifi connection between the IoT and server to something else?
In Raspbian for general browsing, you can add following command in /etc/environment.
export http_proxy="http://username:password#host:port/"
For apt-get, you can add commands in /etc/apt/apt.conf.d/10proxy.
Acquire::http::Proxy "http://username:password#host:port";
But if there are other communications except http protocol, you need to config the proxy in your app and implement all the service in the proxy.
I'm not sure whether to ask this question on a programming forum or linux administration forum as it involves both programming with web sockets and server admin. Basically I am trying to follow this guide "http://41j.com/blog/2014/12/simple-websocket-example-golang/". I have a centos basic server that has a static IP and I've port forwarded it to ports 22 and 80 (ssh and http). I can compile and run the server app fine, but i cannot connect the client. I'm currently out of ideas since I've never messed with networking before. I read somewhere that html5 websockets go through ports 80 and 443 when given an external IP. What I want is to start the server app on port say something like 1445 and then lets pretend my external IP is 244.214.21.44 and then have client connection string look like 'ws//244.214.21.44:1445/echo'. What am I missing, do I need to install apache or something?
Thanks for reading.
I built a Nodejs HTTP server. It's running on localhost:3000.
From outside the Local Area Network, how does one make a request to the private HTTP server? Messing with the router manually is not an option; process should be automated.
I've looked at various techniques - and I'm confused:
Mapping the localhost port to the external ip address (node-nat-pmp)
HTTP tunneling (node-tunnel)
SOCKS (shadowsocks-nodejs)
CONNECT method in request header
It seems that everything is built for a client tunneling out through a firewall, I want to tunnel a request in through the firewall and to a private server. Or just run the localhost port on the external ip.
Any help would be appreciated. Confused.
If you need to access an internal service from outside of your network, you typically have two options:
Configure Port Forwarding on your router - You mentioned this isn't a possibility
Use UPnP to ask your router to open a port for you - This is often disabled as it is a security risk, but if not, look into https://github.com/TooTallNate/node-nat-pmp