项目作者: bvolpato

项目描述 :
:ghost: Ghost Me - Java HTTP Proxifier
高级语言: Java
项目地址: git://github.com/bvolpato/ghostme4j.git
创建时间: 2016-03-24T23:51:55Z
项目社区:https://github.com/bvolpato/ghostme4j

开源协议:Apache License 2.0

下载


ghostme4j

:ghost: Ghostme4j - HTTP Proxifier
Search and use proxies in an easy way.

Apache License
Build Status
Maven Central

Download

Download the latest JAR or grab via Maven:

  1. <dependency>
  2. <groupId>org.brunocvcunha.ghostme4j</groupId>
  3. <artifactId>ghostme4j</artifactId>
  4. <version>0.2</version>
  5. </dependency>

or Gradle:

  1. compile 'org.brunocvcunha.ghostme4j:ghostme4j:0.2'

Snapshots of the development version are available in Sonatype’s snapshots repository.

ghostme4j requires at minimum Java 6.

Usage Example

  1. Proxy used = GhostMe.ghostMySystemProperties(true); //true if it needs to test proxy connectivity/anonymity
  2. URL url = new URL("https://github.com/brunocvcunha/ghostme4j");
  3. URLConnection conn = url.openConnection(used.getJavaNetProxy());

or apply to the system properties (http.proxyHost and http.proxyPort), and no need to pass it in parameters:

  1. Proxy used = GhostMe.getProxy(true); //true if it needs to test proxy connectivity/anonymity
  2. URL url = new URL("https://github.com/brunocvcunha/ghostme4j");
  3. URLConnection conn = url.openConnection();

You can also get a random User-Agent, to fake a real browser connection (e.g. Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36)

To apply in the system properties:

  1. GhostMe.applyUserAgent();

Or to get an User-Agent:

  1. String userAgent = GhostMe.getRandomUserAgent();

Full GhostMe example:

  1. Proxy used = GhostMe.ghostMySystemProperties(true); //true if it needs to test proxy connectivity/anonymity
  2. URL url = new URL("https://github.com/brunocvcunha/ghostme4j");
  3. URLConnection conn = url.openConnection(used.getJavaNetProxy());
  4. conn.addRequestProperty(HttpHeaders.USER_AGENT, GhostMe.getRandomUserAgent());