lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi,

You  have to create a coorect response key to signal the client that your server really does understand websockets.
Read the RFC for the details.

My Lua based web socket server's implementation is:

local key = cgi.header('sec-websocket-key')

key = require('sha1')( key .. '258EAFA5-E914-47DA-95CA-C5AB0DC85B11', false )
cgi.setheader( 'Sec-WebSocket-Accept', require('mime').b64( key ) )


--
Oliver Kroth


Am 03.01.20 um 19:56 schrieb Srinivas Murthy:
>From some client machines (not all) I get this err message connecting
to the same server.

Could not connect websocket ws://xxx:3002/test/ err Websocket
Handshake failed: Invalid Sec-Websocket-Accept (expected
xihPkLi8kE/k3JHo0sG7oTrQm7Q= got nil)

Any ideas what this is about?

Thanks