i want to make my server in python socket online for every one in the world not just for my network home

Viewed 33

The question is that I am working on a messaging program in Python and it works, but only on my home network. I want it to work on an online level for my friends, and I was working on the program with Python socket. I hope you understand the question

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)
1 Answers
Related