vbmithr/ocaml-websocket — pull request #10 by acm (2013-11-23 16:43:12+00:00)
Title: Modify open to accept extra headers that will be sent to the server.  Th...

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