[Libwebsockets] regarding associating websocket server to a domain
Suman.Patro-TRN at lntebg.com
Sun May 15 14:03:21 CEST 2016
OK, Thank you. So, in short I should buy or rent a domain space and add that to the /etc/hosts? But I work on a windows machine and /etc/hosts looks a linux folder structure , so what should be the respective folder form windows?
The solution you suggested is for a single machine , if I would want my websocket server be connected from any machine on the internet, what should I do?
Thanks and regards,
From: Andy Green <andy at warmcat.com>
Sent: Sunday, May 15, 2016 4:44 AM
To: Suman.Patro-TRN; libwebsockets at ml.libwebsockets.org
Subject: Re: [Libwebsockets] regarding associating websocket server to a domain
On May 15, 2016 12:50:24 AM GMT+08:00, "Suman.Patro-TRN" <Suman.Patro-TRN at lntebg.com> wrote:
>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.
whatever.com is resolved by the guy using it to an ip address.
- 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)
> Please suggest. Awaiting response.
> Thanks and regards,
>Larsen & Toubro Limited
>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
Larsen & Toubro Limited
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.
More information about the Libwebsockets