[Libwebsockets] regarding associating websocket server to a domain

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



On 05/15/2016 08:03 PM, Suman.Patro-TRN wrote:
>
> ________________________________
>
> 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

No, you can fake a domain name for one machine by adding it to 
/etc/hosts.  Or you can buy and configure a domain name that everyone 
can see.

> /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? Please suggest.

That's completely unrelated to lws, and actually all done completely 
outside your server.

I googled "how to set up a domain name" and I see lots of good articles.

-Andy

> Thanks and regards, Suman
>
>
>
> ________ 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:
>> 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
>
> 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