Theldus / wsServer

wsServer - a tiny WebSocket server library written in C
https://theldus.github.io/wsServer
GNU General Public License v3.0
422 stars 80 forks source link

<feature> Accessing to connection headers #39

Open lgg2 opened 2 years ago

lgg2 commented 2 years ago

Hello,

It will be a good option to have access to the header parameters (X-Real_IP, X-....) of the handshaking part to get access to a other data like client IP or an ID in the case of proxy forwarding (NGINX) because later with the ws_getaddress function only get the server IP.

Thanks.

Theldus commented 2 years ago

Hi @lgg2, Yes, in fact it would be a very interesting feature, and it's something I also wanted to add to wsServer.

I would like to ask how do you think it could be? maybe a hashmap where the header parameters are the keys and the content the value? if so maybe I'll use something like khash for that, as it's pretty lightweight and efficient.