https://github.com/shenfeng/async-http-client
A fast async http client based on netty
https://github.com/shenfeng/async-http-client
Last synced: 5 months ago
JSON representation
A fast async http client based on netty
- Host: GitHub
- URL: https://github.com/shenfeng/async-http-client
- Owner: shenfeng
- Created: 2011-09-13T15:14:09.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2013-03-29T23:54:30.000Z (over 13 years ago)
- Last Synced: 2025-10-21T21:03:01.491Z (9 months ago)
- Language: Java
- Homepage: http://shenfeng.me
- Size: 225 KB
- Stars: 43
- Watchers: 6
- Forks: 14
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-java - Async Http Client
README
An Async HTTP Client Based on [Netty](http://netty.io/)
I write this for my personal part time project
[RSSMiner](http://rssminer.net), for the web crawler and feed fetcher module.
Please checkout out [http-kit](https://github.com/http-kit/http-kit), it should have better performance.
```xml
clojars.org
http://clojars.org/repo
me.shenfeng
async-http-client
1.1.0
```
```clj
; You may want to write an wrapper function to make it easier to use in Clojure project
[me.shenfeng/async-http-client "1.1.0"]
```
Features
--------
* Asynchronous
* Minimum: just download webpages from Internet efficently.
* Support SOCKS v5, HTTP proxy
* HTTPS(trust all)
* [Configurable](https://github.com/shenfeng/async-http-client/blob/master/src/java/me/shenfeng/http/HttpClientConfig.java)
* [DNS prefetch](https://github.com/shenfeng/async-http-client/blob/master/src/java/me/shenfeng/dns/DnsPrefecher.java),
Limitations:
------------
* All Content are buffered in memory as byte array=> can not handle
large file. Anyway, it's meant to download webpages(zipped if server
support)
* Dns prefetch is IPV4 only.
Example
-------
```java
// Http client sample usage
HttpClientConfig config = new HttpClientConfig();
header = new HashMap();
HttpClient client = new HttpClient(config);
URI uri = new URI("http://onycloud.com");
final HttpResponseFuture future = client.execGet(uri, header);
resp.addListener(new Runnable() {
public void run() {
HttpResponse resp = future.get(); // async
}
});
HttpResponse resp = future.get(); // blocking
```
### License
Copyright © 2012 [Feng Shen](http://shenfeng.me/). Distributed under the [Apache License Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html).