[Libwebsockets] regarding associating websocket server to a domain

Andy Green andy at warmcat.com
Sun May 15 01:14:42 CEST 2016



On May 15, 2016 12:50:24 AM GMT+08:00, "Suman.Patro-TRN" <Suman.Patro-TRN at lntebg.com> wrote:
>Hello,
>
>I have created a websocket server using libwebsockets master version
>and created an html script as a client  using the test.html as a
>reference. Currently  I type http://ip:port in my browser to connect to
>my websocket server. But I would like to use a domain name and connect
>using a domain name (for eg. http://whatever.com)instead of ip:port .
>For this to achieve what additional configurations do I need to do
>(both at the server and client end )and how?

Short answer: nothing, it will just work.

Long answer:

whatever.com is resolved by the guy using it to an ip address.

If you 

 - don't have multiple vhosts on the server, and 

 - don't use ssl

 - use the well-known port (80 for http)

as in your example, there's nothing you need to do.

You can test it by adding whatever.com to your /etc/hosts, that will fake the domain name just for that machine: it should just work.

For the exceptions:

 - multiple vhosts: you must name the vhosts on the server with the correct domain name

 - ssl: again vhosts must be named correctly so SNI can match the client to the right ssl certs

 - nonstandard port: client must supply the port (http://example.com:1234)

-Andy

>            Please suggest. Awaiting response.
>
>            Thanks and regards,
>
>             Suman
>
>Larsen & Toubro Limited
>
>www.larsentoubro.com
>
>This Email may contain confidential or privileged information for the
>intended recipient (s). If you are not the intended recipient, please
>do not use or disseminate the information, notify the sender and delete
>it from your system.
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Libwebsockets mailing list
>Libwebsockets at ml.libwebsockets.org
>http://libwebsockets.org/mailman/listinfo/libwebsockets




More information about the Libwebsockets mailing list