Important: Please read the Qt Code of Conduct -

Is it possible to to create a server with several endpoints by QWebSocketServer?

  • Could I use QWebSocketServer to "register" different endpoints like




    I have wrote a simple application by QWevSocketServer, but have no idea how could I add more endpoints to it. If there is no way or hard to be done by QWebSocketServer, I will add a "mode" field in my json file in order to process different tasks. Thank you very much.

  • Moderators

    @tham Sure. But not like you would think. Basically once you accept the connection to the websocket, you can then get the URL with something like sock->requestUrl() and then act accordingly based on the URL you received.

Log in to reply