https://github.com/bvolpato/ghostme4j
:ghost: Ghost Me - Java HTTP Proxifier
https://github.com/bvolpato/ghostme4j
anonymous java privacy proxy user-agent
Last synced: about 1 year ago
JSON representation
:ghost: Ghost Me - Java HTTP Proxifier
- Host: GitHub
- URL: https://github.com/bvolpato/ghostme4j
- Owner: bvolpato
- License: apache-2.0
- Created: 2016-03-24T23:51:55.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-08-12T05:24:22.000Z (almost 9 years ago)
- Last Synced: 2025-03-25T14:51:15.830Z (over 1 year ago)
- Topics: anonymous, java, privacy, proxy, user-agent
- Language: Java
- Homepage:
- Size: 36.1 KB
- Stars: 10
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
ghostme4j
========
:ghost: Ghostme4j - HTTP Proxifier
Search and use proxies in an easy way.
[](https://github.com/brunocvcunha/ghostme4j/blob/master/LICENSE)
[](https://travis-ci.org/brunocvcunha/ghostme4j)
[](https://maven-badges.herokuapp.com/maven-central/org.brunocvcunha.ghostme4j/ghostme4j)
Download
--------
Download [the latest JAR][1] or grab via Maven:
```xml
org.brunocvcunha.ghostme4j
ghostme4j
0.2
```
or Gradle:
```groovy
compile 'org.brunocvcunha.ghostme4j:ghostme4j:0.2'
```
Snapshots of the development version are available in [Sonatype's `snapshots` repository][snap].
ghostme4j requires at minimum Java 6.
Usage Example
--------
```java
Proxy used = GhostMe.ghostMySystemProperties(true); //true if it needs to test proxy connectivity/anonymity
URL url = new URL("https://github.com/brunocvcunha/ghostme4j");
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:
```java
Proxy used = GhostMe.getProxy(true); //true if it needs to test proxy connectivity/anonymity
URL url = new URL("https://github.com/brunocvcunha/ghostme4j");
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:
```java
GhostMe.applyUserAgent();
```
Or to get an User-Agent:
```java
String userAgent = GhostMe.getRandomUserAgent();
```
Full GhostMe example:
```java
Proxy used = GhostMe.ghostMySystemProperties(true); //true if it needs to test proxy connectivity/anonymity
URL url = new URL("https://github.com/brunocvcunha/ghostme4j");
URLConnection conn = url.openConnection(used.getJavaNetProxy());
conn.addRequestProperty(HttpHeaders.USER_AGENT, GhostMe.getRandomUserAgent());
```
[1]: https://search.maven.org/remote_content?g=org.brunocvcunha.ghostme4j&a=ghostme4j&v=LATEST
[snap]: https://oss.sonatype.org/content/repositories/snapshots/