免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 28369 | 回复: 12
打印 上一主题 下一主题

帮忙推荐一个轻量级的Http库 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-10-12 13:41 |只看该作者 |倒序浏览
下面这些http库,看了下描述,感觉太大了!!http-tiny (Artistic License)这个比较小,但是下载不了!!
就是抓取个网页,最多使用个 代理服务器功能,一编译还带个dll或so个尾巴那么大。。太臃肿了。。
有没其他轻量级的http库推荐??

http://curl.haxx.se/libcurl/competitors.html

Free Software and Open Source projects have a long tradition of forks and duplicate efforts. We enjoy "doing it ourselves", no matter if someone else has done something very similar already.

Free/open libraries that cover parts of libcurl's features:

libcurl (MIT)

      a highly portable and easy-to-use client-side URL transfer library, supporting FTP, FTPS, HTTP, HTTPS, SCP, SFTP, TELNET, DICT, FILE, TFTP and LDAP. libcurl also supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading, kerberos, HTTP form based upload, proxies, cookies, user+password authentication, file transfer resume, http proxy tunnelling and more!

libghttp (LGPL)

      Having a glance at libghttp (a gnome http library), it looks as if it works rather similar to libcurl (for http). There's no web page for this and the person who's email is mentioned in the README of the latest release I found claims he has passed the leadership of the project to "eazel". Popular choice among GNOME projects.

libwww (W3C license) comparison with libcurl

      More complex, and and harder to use than libcurl is. Includes everything from multi-threading to HTML parsing. The most notable transfer-related feature that libcurl does not offer but libwww does, is caching.

libferit (GPL)

      C++ library "for transferring files via http, ftp, gopher, proxy server". Based on 'snarf' 2.0.9-code (formerly known as libsnarf). Quote from freshmeat: "As the author of snarf, I have to say this frightens me. Snarf's networking system is far from robust and complete. It's probably full of bugs, and although it works for maybe 85% of all current situations, I wouldn't base a library on it."

neon (LGPL)

      An HTTP and WebDAV client library, with a C interface. I've mainly heard and seen people use this with WebDAV as their main interest.

libsoup (LGPL) comparison with libcurl

      Part of glib (GNOME). Supports: HTTP 1.1, Persistent connections, Asynchronous DNS and transfers, Connection cache, Redirects, Basic, Digest, NTLM authentication, SSL with OpenSSL or Mozilla NSS, Proxy support including SSL, SOCKS support, POST data. Probably not very portable. Lacks: cookie support, NTLM for proxies, GSS, gzip encoding, trailers in chunked responses and more.

mozilla netlib (MPL)

      Handles URLs, protocols, transports for the Mozilla browser.

mozilla libxpnet (MPL)

      Minimal download library targeted to be much smaller than the above mentioned netlib. HTTP and FTP support.

wget (GPL)

      While not a library at all, I've been told that people sometimes extract the network code from it and base their own hacks from there.

libfetch (BSD)

      Does HTTP and FTP transfers (both ways), supports file: URLs, and an API for URL parsing. The utility fetch that is built on libfetch is an integral part of the FreeBSD operating system.

HTTP Fetcher (LGPL)

      "a small, robust, flexible library for downloading files via HTTP using the GET method."

http-tiny (Artistic License)

      "a very small C library to make http queries (GET, HEAD, PUT, DELETE, etc.) easily portable and embeddable"

XMLHTTP Object also known as IXMLHTTPRequest (part of MSXML 3.0)

      (Windows) Provides client-side protocol support for communication with HTTP servers. A client computer can use the XMLHTTP object to send an arbitrary HTTP request, receive the response, and have the Microsoft® XML Document Object Model (DOM) parse that response.

QHttp (GPL)

      QHttp is a class in the Qt library from Troll Tech. Seems to be restricted to plain HTTP. Supports GET, POST and proxy. Asynchronous.

ftplib (GPL)

      "a set of routines that implement the FTP protocol. They allow applications to create and access remote files through function calls instead of needing to fork and exec an interactive ftp client program."

ftplibpp (GPL)

      A C++ library for "easy FTP client functionality. It features resuming of up- and downloads, FXP support, SSL/TLS encryption, and logging functionality."

GNU Common C++ library

      Has a URLStream class. This C++ class allow you to download a file using HTTP. See demo/urlfetch.cpp in commoncpp2-1.3.19.tar.gz

HTTPClient (LGPL)

      Java HTTP client library.

Jakarta Commons HttpClient (Apache License)

      A Java HTTP client library written by the Jakarta project.

论坛徽章:
1
午马
日期:2013-08-23 23:39:47
2 [报告]
发表于 2011-10-12 13:45 |只看该作者
curl 不大的

论坛徽章:
0
3 [报告]
发表于 2011-10-12 13:47 |只看该作者
sf上也没搜罗到,自己写了一个,也可以使用代理服务器啥的,感觉没开源强大。。

论坛徽章:
0
4 [报告]
发表于 2011-10-12 13:54 |只看该作者
本帖最后由 chary8088 于 2011-10-12 13:56 编辑

好几百K了,比程序本身还大
编译时还要装好几个库,有点恐怖,除了ssl
curl 不大的
phy0077 发表于 2011-10-12 13:45

论坛徽章:
0
5 [报告]
发表于 2011-10-12 15:10 |只看该作者
Up

论坛徽章:
0
6 [报告]
发表于 2011-10-12 15:31 |只看该作者
如果只是抓取个网页,自己实现http协议细节也很简单。

论坛徽章:
0
7 [报告]
发表于 2011-10-12 16:12 |只看该作者
http://www.cnblogs.com/skynet/archive/2010/07/24/1784110.html这个不错,代码我已经分析过了,不算复杂。基本功能都有

论坛徽章:
0
8 [报告]
发表于 2011-10-12 16:17 |只看该作者
这个不错,代码我已经分析过了,不算复杂。基本功能都有
syoubin_sai 发表于 2011-10-12 16:12



    你问的是客户端,上面的你用不了。

论坛徽章:
0
9 [报告]
发表于 2011-10-12 16:43 |只看该作者
回复 8# syoubin_sai


嗯    这个是服务器的

libcurl编译成静态库也有300多K。。有点大头了

论坛徽章:
0
10 [报告]
发表于 2011-10-12 16:46 |只看该作者
回复  syoubin_sai


嗯    这个是服务器的

libcurl编译成静态库也有300多K。。有点大头了
chary8088 发表于 2011-10-12 16:43



    自己写吧,这个不难。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP