Project

General

Profile

[OT] lighttpd & websocket working route.

Added by scg about 6 years ago

Hi. I'm not good at english. Please afford me.

I'm using lighttpd-1.4.49. I want to use lighttpd & websocket. I add the mod_wstunnel in lighttpd.conf then it's works. But I don't know how that is work.

I find that first request in browser to server, browser upgrade socket to websocket.
Then data that is from browser request catched by fdevent.

But I don't know how to receive the data from browser and process data in server, response data to browser and it's working route.

Please teach me how lighttpd and websocket work. Thanks.


Replies (1)

RE: lighttpd & websocket working route. - Added by gstrauss almost 6 years ago

You can use lighttpd as a front-end which proxies back to a websocket server. See Docs_ModProxy

server.modules += ( "mod_proxy" )
proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => "8888" ) ) )
proxy.header = ( "upgrade" => "enable" )

However, you still need a websocket server, and this site is not the place for you. Please use your favorite search engine and use terms such as "websocket server example".

Start with https://www.websocket.org/book.html or https://medium.com/@martin.sikora/libwebsockets-simple-websocket-server-68195343d64b

    (1-1/1)