VProxy is a zero-dependency TCP Loadbalancer based on Java NIO. The project only requires Java 11 to run.
Clone it, compile it, then everything is ready for running.
Host
header considerationWebSocksProxyAgent
and WebSocksProxyServer
See the release page.
Use the latest vproxy-linux
binary file in release page.
Or
Use the jlink built runtime here.
Use the latest vproxy-macos
binary file in release page.
Java runtime can be found here.
Use the jlink built runtime here.
NOTE: the runtime is in beta state.
./gradlew clean jar
java -jar build/libs/vproxy.jar -Deploy=HelloWorld
make jlink
./build/image/bin/vproxy -Deploy=HelloWorld
docker build --no-cache -t vproxy:latest https://raw.githubusercontent.com/wkgcass/vproxy/master/docker/Dockerfile
docker run --rm vproxy -Deploy=HelloWorld
./gradlew clean jar
native-image -jar build/libs/vproxy.jar --enable-all-security-services --no-fallback --no-server vproxy
./vproxy -Deploy=HelloWorld
Only macos(bsd)/linux supported. And you might need to set the JAVA_HOME
env variable before compiling.
make vfdposix
java -Dvfd=posix -Djava.library.path=./base/src/main/c -jar build/libs/vproxy.jar -Deploy=HelloWorld
For info about F-Stack
, check the doc fstack-how-to.md.
And there's a special version for windows to support Tap devices: -Dvfd=windows
, however the normal fds and event loop are stll based on jdk selector channel.
make vfdwindows
java -Dvfd=posix -Djava.library.path=./base/src/main/c -jar build/libs/vproxy.jar -Deploy=HelloWorld
Run test cases:
./gradlew runTest
Test vswitch, docker network plugin, vpctl, k8s controller:
# requires virtualbox installed
cd ./misc/auto-setup/
./auto-setup.sh
./auto-verify.sh
Add crd, launch vproxy and controller
kubectl apply -f https://github.com/vproxy-tools/vpctl/blob/master/misc/crd.yaml
kubectl apply -f https://github.com/vproxy-tools/vpctl/blob/master/misc/k8s-vproxy.yaml
Launch the example app
kubectl apply -f https://github.com/vproxy-tools/vpctl/blob/master/misc/cr-example.yaml
Detailed info can be found here.
A command line client application is provided to manipulate the vproxy instance. You may see more info in vpctl repo.
This tool is fully tested and simple to use. Some examples are provided in the tool repo for reference.
You can start a simple loadbalancer in one command:
java -Deploy=Simple -jar vproxy.jar \
bind {port} \
backend {host1:port1,host2:port2} \
[ssl {path of cert1,cert2} {path of key} \]
[protocol {...} \]
Use help
to view the parameters.
Use help
to view the launching parameters.
When launching the vproxy instance, a http-controller
on port 18776 and a resp-controller
on port 16309 will be started. Then you can operate the vproxy instance using curl
or redis-cli
. You may also operate the vproxy instance directly using standard input (stdin).
See command.md and api doc for more info.
Questions about implementation detail are also welcome (in issues).
F-Stack
. Chinese version only for now.direct-relay
in vpws-agent
.Currently only I
myself is working on this project. I would be very happy if you want to join :)
Thanks to Jetbrains for their great IDEs and the free open source license.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。