Connection helpers: for people interested in network code

I generally find that I'm wrapping sockets in the same functions a lot and now I'm looking writings code which works with both Sockets and SSL connections. So I wrote a module, presumptuously called Network.Connection, although I'm not actually going to try and take that name (even in Hackage) unless I get a general agreement that this is a good thing. So, any comments on the interface, similar things that I should look at etc? http://www.imperialviolet.org/binary/network-connection/Network-Connection.h... I made the BaseConnection an ADT, rather than a class because I wanted to avoid hitting the monomorphism restriction in code. That might have been a mistake, I'm not sure yet. If it doesn't excite anyone enough to reply, I'll change the name and put it in Hackage, mostly as is. Then I'll tie HsOpenSSL into it so that SSL connections work transparently. Cheers, AGL -- Adam Langley agl@imperialviolet.org http://www.imperialviolet.org

On Fri, Feb 29, 2008 at 8:50 PM, Adam Langley
I generally find that I'm wrapping sockets in the same functions a lot and now I'm looking writings code which works with both Sockets and SSL connections. So I wrote a module, presumptuously called Network.Connection, although I'm not actually going to try and take that name (even in Hackage) unless I get a general agreement that this is a good thing.
So, any comments on the interface, similar things that I should look at etc?
http://www.imperialviolet.org/binary/network-connection/Network-Connection.h...
I made the BaseConnection an ADT, rather than a class because I wanted to avoid hitting the monomorphism restriction in code. That might have been a mistake, I'm not sure yet.
If it doesn't excite anyone enough to reply, I'll change the name and put it in Hackage, mostly as is. Then I'll tie HsOpenSSL into it so that SSL connections work transparently.
Hi Adam, you may want to have a look at the socket abstraction used in the HTTP package: http://hackage.haskell.org/packages/archive/HTTP/3001.0.4/doc/html/Network-S... It would be great to get HTTPS support going! /Bjorn

On Tue, Mar 4, 2008 at 7:31 AM, Bjorn Bringert
you may want to have a look at the socket abstraction used in the HTTP package:
http://hackage.haskell.org/packages/archive/HTTP/3001.0.4/doc/html/Network-S...
It would be great to get HTTPS support going!
I should have mentioned that I had seen this in the original email. I think the major problem with this interface was that it was written in the time before ByteStrings. Now that we have ByteStrings I think that it makes a lot of sense for networking to use them. However, it shouldn't be too hard to wrap HsOpenSSL in this interface. I might try this this week. Then HTTPS should Just Work (maybe ;) AGL -- Adam Langley agl@imperialviolet.org http://www.imperialviolet.org

On Tue, Mar 4, 2008 at 5:15 PM, Adam Langley
On Tue, Mar 4, 2008 at 7:31 AM, Bjorn Bringert
wrote: you may want to have a look at the socket abstraction used in the HTTP package:
http://hackage.haskell.org/packages/archive/HTTP/3001.0.4/doc/html/Network-S...
It would be great to get HTTPS support going!
I should have mentioned that I had seen this in the original email. I think the major problem with this interface was that it was written in the time before ByteStrings. Now that we have ByteStrings I think that it makes a lot of sense for networking to use them.
However, it shouldn't be too hard to wrap HsOpenSSL in this interface. I might try this this week. Then HTTPS should Just Work (maybe ;)
There is some (dormant?) work on bringing HTTP into the age of the ByteString. Thomas Schilling (nominolo) might be able to tell you more about it. /B

On 5 mar 2008, at 22.05, Bjorn Bringert wrote:
There is some (dormant?) work on bringing HTTP into the age of the ByteString. Thomas Schilling (nominolo) might be able to tell you more about it.
Well, I can say with certainty that I won't have the time nor energy to bring this into a usable state anytime soon (speak: not this year). I think it's unlikely that Jonas will, either. Our work was a quick hack, meant mainly as a proof of concept. Doing it well would require work and more knowledge of the HTTP protocol than I have, ATM. I agree that it would be valuable to the community, but it's not gonna be me. I wonder, though, what happened to the curl bindings for Haskell? This was a Summer of Code project last year. Also Johan Tibell expressed some interest in getting bytestrings for HTTP. / Thomas

nominolo:
On 5 mar 2008, at 22.05, Bjorn Bringert wrote:
There is some (dormant?) work on bringing HTTP into the age of the ByteString. Thomas Schilling (nominolo) might be able to tell you more about it.
Well, I can say with certainty that I won't have the time nor energy to bring this into a usable state anytime soon (speak: not this year). I think it's unlikely that Jonas will, either. Our work was a quick hack, meant mainly as a proof of concept. Doing it well would require work and more knowledge of the HTTP protocol than I have, ATM. I agree that it would be valuable to the community, but it's not gonna be me.
I wonder, though, what happened to the curl bindings for Haskell? This was a Summer of Code project last year. Also Johan Tibell expressed some interest in getting bytestrings for HTTP.
$ git clone http://code.haskell.org/curl.git :) But really, we want an no-errors bytestring-efficient http of our own.
participants (4)
-
Adam Langley
-
Bjorn Bringert
-
Don Stewart
-
Thomas Schilling