problem with socket programming on my host

39
February 11, 2019, at 7:30 PM

i wanted to use a website to send some commands to a client app but in my host i can just access to ports 80 and 443 is it possible that i make socket programming with these ports?

i have tried my code on some ports like 8889 and but these are not available on my host

    def send_to_client(key)://///the function on website that sends data to client
        HOST = '10.42.0.158'  # The server's hostname or IP address
        PORT = 8889       # The port used by the server
        connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        connection.connect((HOST, PORT))
        print("problem with socket")
        # old = termios.tcgetattr(sys.stdin)
        tty.setcbreak(sys.stdin.fileno())
        try:    
            /////if key is ok send it to client app
                connection.sendall(key)
                return key + " sent succesfully"
            else:
                return "not proper input"
                            # key = sys.stdin.read(1)
        finally:
            termios.tcsetattr(sys.stdin, termios.TCSADRAIN, old)    
    def recv_data()://///the function on client app that receive data from website
        global data
        #now keep talking with the client
        while 1:
            #wait to accept a connection - blocking call
            conn, addr = s.accept()
            print ('Connected with ' + addr[0] + ':' + str(addr[1]))
            while True:
                d = conn.recv(1024).strip().decode('utf-8')
                data = d
                break

i want to know that is it possible that use port 80 to do this socket programming app

READ ALSO
how to print sum of primes in a list in python?

how to print sum of primes in a list in python?

How do I print sum of primes in a list in Python?

30
Why Can't I use ResponseEntity<?> annotation with StreamingResponseBody body type?

Why Can't I use ResponseEntity<?> annotation with StreamingResponseBody body type?

I am trying to return a ResponseEntity Object with my Spring Action, the response entity mainly going to be ResponseEntity<StreamingResponseBody>Although if an exception occures I am required to return a response entity which has another type i

38
how to export the contents of a filtered jTable to a pdfpTable

how to export the contents of a filtered jTable to a pdfpTable

I have a JTable and am using JFilter to filter its contents based on user inputNow i intend to export the contents of the JTable to a PdfPTable using iText library

49
How do we solve error 554 5.5.1 (no valid recipients) when using PHP Swiftmailer?

How do we solve error 554 5.5.1 (no valid recipients) when using PHP Swiftmailer?

When testing out our mail server we stumbled accross an error that prevents us from sending mails via PHP, though regular sending/receiving per Mail-in-a-box works without any problemsWe are running a separate Ubuntu 18

21