Re[2]: [Haskell-cafe] ANN: HTTPbis / HTTP-4000.x package available

2009-01-16 Thread Bulat Ziganshin
Hello Sigbjorn,

Friday, January 16, 2009, 5:42:06 PM, you wrote:

first question: are these packages (http, curl, curl-shell, webclient)
windows-compatible? second - that is advantages of using http (or
webclient) over curl?

sorry if questions are stupid - i'm pretty ignorant here :)


> Thanks Jeff,

> regarding having to use both HTTP and cURL -- or perhaps only
> the latter for code simplicitly -- that will probably remain the case for
> quite a while still. To help with that situation,  I put together an 
> over-arching
> 'webclient' library that abstracts over the transport layers (HTTP, curl,
> curl-shell) giving you an API that's consistent across backends.
> I could release that at some point if there's sufficient interest..
> It also adds WebDAV support.

> Re: curl - as an author of the 'curl' package, I'm also keen on finding
> ways of making that better -- both in terms of using the underlying lib
> functionality and API on the Haskell side. Suggestions/contribs most
> welcome.

> Ditto for HTTP too, of course :)

> --sigbjorn

> On 1/16/2009 05:47, Jeff Heard wrote:
>> Just as a reported speedup, downloading a 5MB file from my own local
>> machine (via http) went from 1.05 secs to 0.053 secs.  Yes, it's
>> really an order of magnitude better.  Performance now is on par or
>> slightly better than cURL (however to get more protocols than HTTP,
>> you'll still need the ubiquitous cURL library)
>>
>> On Fri, Jan 16, 2009 at 1:36 AM, Sigbjorn Finne
>>  wrote:
>>   
>>> Hi,
>>>
>>> I guess it's time to publish more widely the availability of a modernization
>>> of
>>> the venerable and trusted HTTP package, which I've been working on
>>> off&on for a while.
>>>
>>> Bunch of changes, but the headline new feature of this new version
>>> is the parameterization of the representation of payloads in both HTTP
>>> requests and responses. Two new representations are supported, strict and
>>> lazy
>>> ByteStrings. Some people have reported quietly pleasing speedups as a result
>>> of this change. (If they want to report numbers, please do..)
>>>
>>> Another change/fix in this release is the _alleged_ fix to the long-standing
>>> bug
>>> in the use of  absolute URIs vs absolute paths in requests (for non-proxied
>>> and
>>> proxied use.) Give it a go..
>>>
>>> Notice that the HTTP-4000.x version will require you to make some
>>> modifications to your existing HTTP-using code -- I've tried to keep the API
>>> backwards compatible minimal despite the change in functionality and
>>> underlying types. If you do not want to deal with this right away, please
>>> introduce a <4000 dependency on the HTTP package in your .cabal files.
>>>
>>> I've also taken on the maintainership of the package, with the highly
>>> esteemed
>>> Bjorn Bingert no longer having the usual abundance of cycles to look after
>>> it (hope I'm not misrepresenting facts here, Bjorn!) However, I've yet to
>>> gain access to  www.haskell.org and update http://www.haskell.org/http,
>>> so for now you may pick up a new version the lib via
>>>
>>>  http://hackage.haskell.org/cgi-bin/hackage-scripts/package/HTTP
>>>
>>> GIT repo for HTTP-4000  / HTTPbis is here
>>>
>>>   git://code.galois.com/HTTPbis.git
>>>
>>> enjoy
>>> --sigbjorn
>>>
>>> ___
>>> Haskell-Cafe mailing list
>>> Haskell-Cafe@haskell.org
>>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>>>
>>> 

> ___
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe


-- 
Best regards,
 Bulatmailto:bulat.zigans...@gmail.com

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: Re[2]: [Haskell-cafe] ANN: HTTPbis / HTTP-4000.x package available

2009-01-17 Thread Duncan Coutts
On Fri, 2009-01-16 at 17:57 +0300, Bulat Ziganshin wrote:
> Hello Sigbjorn,
> 
> Friday, January 16, 2009, 5:42:06 PM, you wrote:
> 
> first question: are these packages (http, curl, curl-shell, webclient)
> windows-compatible? second - that is advantages of using http (or
> webclient) over curl?

I don't know enough about the others to do a proper comparison, but one
data point is that for cabal-install we picked the HTTP package because
it *does* work on Windows and does not need any C libraries, making it
easy to deploy.

[Packages that require external C libraries are possible on Windows of
course but are a pain. For cabal-install we also use the zlib package
which does need the zlib C lib. Fortunately the zlib C lib is
sufficiently simple that it can be built by Cabal and thus it is
possible to have it bundled with the zlib Haskell package.]

I've not looked at the API of the other packages but the HTTP package
provides the Browser module which makes making sequences of requests
fairly easy. It handles proxies, authentication, redirection etc. With
the latest release it should also be rather quicker than it used to be,
and it fixes problems we used to have with some proxies.

Speaking of proxies, I've been looking into how to find the right proxy
to use on Windows systems. Turns out that to do it properly you need a
JavaScript interpreter! Yes, really. Apparently we have Netscape to
thank for that decision. The easiest way appears to be to link to the MS
WinHTTP lib which provides a couple functions for doing this:
http://hackage.haskell.org/trac/hackage/ticket/460

Duncan

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: Re[2]: [Haskell-cafe] ANN: HTTPbis / HTTP-4000.x package available

2009-01-18 Thread Duncan Coutts
On Sat, 2009-01-17 at 20:34 -1000, Tim Newsham wrote:
> > Speaking of proxies, I've been looking into how to find the right proxy
> > to use on Windows systems. Turns out that to do it properly you need a
> > JavaScript interpreter! Yes, really.
> 
> Uhh.. What!?  That's not right.

I think you mean it should not be right! :-) Of course it's possible to
specify a list of proxies in Windows and that info is kept in the
registry. It's also common in corporate networks to use proxy
auto-configuration. The client gets told the URL of the these (.pac)
files and the client downloads it to work out what proxy to use. You'll
notice a space to specify an auto-configuration URL (.pac file) in the
proxy setting dialog of any web browser.

Proxy auto-configuration files are JavaScript. It uses more or less the
full JavaScript language (ECMA these days), though with a small subset
of the standard library.

Web browsers are ok because they've got a JavaScript interpreter. The MS
WinHTTP library uses the Windows scripting host service. The open source
pacparser C library links to the Mozilla SpiderMonkey JavaScript engine.
Apparently we have Netscape to thank for this mess.

Duncan

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe