vbmithr / ocaml-websocket

Websocket library for OCaml
ISC License
163 stars 44 forks source link

Modify open to accept extra headers that will be sent to the server. Th... #10

Closed acm closed 10 years ago

acm commented 10 years ago

Hi,

Thanks very much for writing (and sharing) your websockets code! I'm using it in a project I've been working on to get to know OCaml. Unfortunately, the web server I'm connecting to wants some additional headers on the original HTTP request.

This patch adds the ability to pass a list of additional headers to the server at connection establishment. Accomplishing this seemed pretty straightforward except in the case of a collision between the additional headers and the headers that the websockets module uses. I don't think this case should ever crop up in reality, but I had to handle it somehow so I let the additional headers overwrite the module's.

I hope you like the patch. I'd be happy to revise it in any way you'd like.

Thanks Andy

vbmithr commented 10 years ago

Sorry about that! For some reason I missed the notification and see that just now… I'm looking at it now.

vbmithr commented 10 years ago

Thanks.

acm commented 10 years ago

thank you!