Setting QTcpServer to port 80.



  • I'm attempting to write HTTP server based on TCP. For now, I'm trying to modify fortune client/server example. However, I'm running into a problem of connecting to port 80. I do know that these ports are protected from using, though is there a away to accomplish that somehow?

    tcpServer->listen(QHostAddress::Any, 80)
    

  • Qt Champions 2016

    Hi
    Its not protected as such but already in use often.
    Can you provide more details about os, firewall settings. Over all design / goals ?



  • I have this task at the university to build local http client-server that would execute elementary GET requests. I'm using Ubuntu(not sure about firewall settings). At this point, I don't have any design, I'm simply using fortune client example from standart Qt examples library, trying to make it work on 80(443) port, which is( as far as I get it) basic thing for building http server.


  • Lifetime Qt Champion

    Hi,

    You don't need to use that particular port to develop your application.
    It's usually the front facing application that uses it (apache, nginx, etc).



  • @SGaist But would that count as HTTP server without 80 or 443 port?


  • Lifetime Qt Champion

    80 is just an attributed port number, same for 443.

    The tech answering behind doesn't care at all what the port number is.

    Most web development frameworks use 8080 by default.


Log in to reply