Skip to content
forked from thomaszhao/3proxy

[Still in Programming] 3proxy works as library in JNI thread for Android. 3proxy is Forked from: http://www.3proxy.ru/download/ .

License

Notifications You must be signed in to change notification settings

lineCode/3proxy

 
 

Repository files navigation

3proxy is a tiny proxy server.

I use its http proxy feature in an Android application, it works in a JNI thread. Here is the JNI part code.

About 3proxy:

3Proxy tiny free proxy server is really tiny cross-platform (Win32/Win64&Unix) freeware proxy servers set. It includes HTTP proxy with HTTPS and FTP support, SOCKSv4/SOCKSv4.5/SOCKSv5 proxy (socks/socks.exe), POP3 proxy, SMTP proxy, AIM/ICQ proxy (icqpr/icqpr.exe), MSN messenger / Live messenger proxy (msnpr/msnpr.exe), FTP proxy, caching DNS proxy, TCP and UDP portmappers.

3proxy is forked from: http://www.3proxy.ru/download/ ,

Fetch history:

What did I do

I'm Thomas Zhaohttp://www.thomaszhao.cn.

I use it in an Android application, it works as a JNI thread. So here is the JNI part code:

Features List:

  • Http Proxy runs in a JNI thread.
  • Works well with Android VpnService.

TODO List:

  • nothing.

How to use it in your project?

How to Compile?

I hope it should work in this way:

1): fetch this code into your project as a git submodule:

git submodule add  -b thomas/android_jni   -- "git@github.com:thomaszhao/3proxy.git"  "<your project>/jni"
  1. then in your project's jni/Android.mk file:

    LOCAL_PATH := $(call my-dir) include ../external/3proxy/Android.mk

  2. Wrapper your java like this:

public class ThreeProxy {
	static {
		java.lang.System.loadLibrary("3proxy");
	}

	// 3proxy's main() function
	public static native int RunThreeProxy(String[] cmd);

	// 3proxy's reload signal
	public static native void Reload();

	// 3proxy's terminate signal
	public static native void Terminate();
}

  1. Modify JNI_CLASS_PREFIX macro to match yours in 3proxy/Android.mk

  2. then it can be compiled into lib3proxy.so.

How to tune?

  • Macro THREE_PROXY_JNI: this macro wraps all the modification aims to work as JNI thread.
  • Macro THREE_PROXY_JNI_VPNSERVICE: this macro wraps codes for working with Android VpnService.
  • Macro JNI_CLASS_PREFIX must match your java code path.

A full usage:

TODO

About

[Still in Programming] 3proxy works as library in JNI thread for Android. 3proxy is Forked from: http://www.3proxy.ru/download/ .

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 91.8%
  • C++ 6.2%
  • Makefile 1.2%
  • Other 0.3%
  • Awk 0.3%
  • Shell 0.1%
  • Other 0.1%