[英]How to create a chat room over internet with raspberry pi and python
I have a bit of an open ended questions for you all.我有一些开放式问题要问大家。 I wish to create a simple chat-room such as this example here: https://www.geeksforgeeks.org/simple-chat-room-using-python/ but I am lost as how to do it over the internet rather than just local network.
我希望在这里创建一个简单的聊天室,例如此示例: https://www.geeksforgeeks.org/simple-chat-room-using-python/但我不知道如何通过互联网进行操作,而不仅仅是本地网络。
Any pointers/help would be appricated!任何指针/帮助都会被应用!
Thanks:)谢谢:)
There are multiple ways about this.对此有多种方法。 You can either:
您可以:
The first method requires you to do some port-forwarding on your local network, essentially mapping your 127.0.0.1:8081
local server to your public IP (so you would connect via the internet as myip
: 8081
).第一种方法要求您在本地网络上进行一些端口转发,本质上是将您的
127.0.0.1:8081
本地服务器映射到您的公共 IP (因此您可以通过互联网连接为myip
: 8081
)。 This method, however, comes with its limitations;然而,这种方法有其局限性。 when you turn off your computer you are also effectively turning off your server to the rest of the internet.
当您关闭计算机时,您实际上也关闭了连接到 Internet 的 rest 的服务器。 The second method will ensure the server stays on at all times, and is likely what you are looking for.
第二种方法将确保服务器始终保持打开状态,并且可能是您正在寻找的。 Heroku is a great starting point as they provide a free tier that you can test everything out.
Heroku是一个很好的起点,因为它们提供了一个免费层,您可以测试一切。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.