We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c07a03a commit ec5f8dbCopy full SHA for ec5f8db
1 file changed
examples/network/http_server.py
@@ -13,14 +13,15 @@
13
def main(use_stream=False):
14
s = socket.socket()
15
16
- ai = socket.getaddrinfo("127.0.0.1", 8080)
+ # Binding to all interfaces - server will be accessible to other hosts!
17
+ ai = socket.getaddrinfo("0.0.0.0", 8080)
18
print("Bind address info:", ai)
19
addr = ai[0][4]
20
21
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
22
s.bind(addr)
23
s.listen(5)
- print("Listening, connect your browser to http://127.0.0.1:8080/")
24
+ print("Listening, connect your browser to http://<this_host>:8080/")
25
26
counter = 0
27
while True:
0 commit comments