I have been using NGRok as a server for my chatbot. So i want to create a local server using my static IP & Host that chatbot on it. Anyone knows how to do this?
This depends on the specifics of your chatbot. I assume that it behaves like a HTTP server.
You have to ensure that the following criteria apply:
netstat -atulpen
to check this. If your process is listed with state LISTEN
and a local address of either :::<PORT>
or 0.0.0.0:<PORT>
, then it listens on all interfaces. If the local address is your external ip address, it is also fine! If you see something else here, check your code for the statement were you assign the port to your server. Here you can usually also set the host to listen to, which you could set to an unspecified address ( ::
or 0.0.0.0
) to listen to all interfaces. ufw
as a frontend for iptables
or use the latter directly. ifconfig.co
to see your public ip address and if this matches your static ip address it should work. If the IPs do not match, you might only have a static IP inside your home network, but not one that is publically routed to/from the internet. If the address shown by ifconfig.co
matches the IP of your router, you can enable port forwarding in your router to the host running your server. This, however, strongly depends on how your network is set up. If all of these apply, you should be able to access the server using your public ip and the specified port. But you might want to consider securing the connection by using HTTPS instead of plain HTTP. Depending on the specifics of your setup you should be able to find many guides online on how to accomplish this. Just a few pointers:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.