jaspervdj / websockets

A Haskell library for creating WebSocket-capable servers
http://jaspervdj.be/websockets
BSD 3-Clause "New" or "Revised" License
407 stars 113 forks source link

Expose Connection constructor #216

Closed thomasjm closed 3 years ago

thomasjm commented 3 years ago

I'd like to access the connectionSentClose field of the Connection object, so I can manually send a close message when one hasn't been sent yet. This PR exposes the fields.

jaspervdj commented 3 years ago

@thomasjm Thanks! The Connection constructor is already exposed from Network.WebSockets.Connection module. I'm not sure if I want to expose it from the "main" WebSockets module since I think most people don't need it. I'm happy to add an export for the Http module, but in that case we should also add a note there that it's mostly internal.

thomasjm commented 3 years ago

Oh sorry, I didn't mean to push the Network.WebSockets.Http commit to this same branch. That was an experiment I was doing, please ignore.

Ah, I didn't realize the Connection constructor was exported there. I'll just close this PR then. Thanks!