![](/img/trans.png)
[英]want to call python api in my javascript code. I just want to check that how hello world is called from python and printed in javascript
[英]i want to make my server in python socket online for every one in the world not just for my network home
問題是我正在 Python 中開發一個消息傳遞程序,它可以工作,但只在我的家庭網絡上工作。 我希望它在我的朋友的在線級別上工作,我正在使用 Python 套接字開發程序。 我希望你明白這個問題
import socket
import threading
def handle_client(conn, addr):
print(f"[NEW CONNECTION] {addr} connected.")
connected = True
while connected:
msg_l = conn.recv(HEADER).decode('utf-8')
if msg_l:
msg_l = int(msg_l)
msg = conn.recv(msg_l).decode('utf-8')
if msg == DISCONNECT:
connected = False
msg_of_client = (f"{addr} : {msg}") # the message of client
print(msg_of_client)
您可能需要檢查端口轉發。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.