1) proxy: LB,DNS,Socks. 2) k8s: CRD and Controllers. 3) sdn: L3 Stackable Virtual Switch.
VProxy is a zero-dependency loadbalancer and sdn virtual switch. The project only requires Java 22 to run.
Clone it, compile it, then everything is ready for running.
Host
header considerationWebSocksProxyAgent
and WebSocksProxyServer
vproxy-linux
binary file in release page.vproxy-macos
binary file in release page.shell
make init
./gradlew clean shadowjar
java -jar build/libs/vproxy.jar -Deploy=HelloWorld
make jlink
./build/image/bin/vproxy -Deploy=HelloWorld
# make docker
docker run -it --rm vproxyio/vproxy -Deploy=HelloWorld
make image
./vproxy -Deploy=HelloWorld
make vfdposix
java -Dvfd=posix -Djava.library.path=./base/src/main/c -jar build/libs/vproxy.jar -Deploy=HelloWorld
-Dvfd=windows
, however the normal fds and event loop are still based on jdk selector channel.make vfdwindows
java -Dvfd=windows -Djava.library.path=./base/src/main/c -jar build/libs/vproxy.jar -Deploy=HelloWorld
apt-get install -y linux-headers-$(uname -r) build-essential libelf-dev clang llvm
, then:make vpxdp
make vpxdp-linux
./gradlew runTest
make dockertest
shell
# requires virtualbox installed
cd ./misc/auto-setup/
./auto-setup.sh
./auto-verify.sh
shell
./gradlew ui:jar
java -cp ./ui/build/libs/vproxy-ui.jar $mainClassName
io.vproxy.ui.calculator.CalculatorMain
: an IPv4 network calculatorgroovy
implementation group: 'io.vproxy', name: 'vproxy-adaptor-netty', version: '1.0.0-BETA-12'
// all available artifacts: dep, base, adaptor-netty, adaptor-vertx
xml
<dependency>
<groupId>io.vproxy</groupId>
<artifactId>vproxy-adaptor-netty</artifactId>
<version>1.0.0-BETA-12</version>
</dependency>
<!-- all available artifacts: dep, base, adaptor-netty, adaptor-vertx -->
java
requires io.vproxy.dep;
requires io.vproxy.base;
requires io.vproxy.adaptor.netty;
requires io.vproxy.adaptor.vertx;
java
var acceptelg = new VProxyEventLoopGroup();
var elg = new VProxyEventLoopGroup(4);
var bootstrap = new ServerBootstrap();
bootstrap
.channel(VProxyInetServerSocketChannel.class)
.childHandler(new ChannelInitializer<>() {
@Override
protected void initChannel(Channel ch) {
ChannelPipeline p = ch.pipeline();
p.addLast(new HttpServerCodec());
p.addLast(new HttpHelloWorldServerHandler());
}
});
bootstrap.group(acceptelg, elg);
bootstrap.bind(hostname, port).sync();
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
kubectl apply -f https://github.com/vproxy-tools/vpctl/blob/master/misc/cr-example.yaml
java -Deploy=Simple -jar vproxy.jar \
bind {port} \
backend {host1:port1,host2:port2} \
[ssl {path of cert1,cert2} {path of key}] \
[protocol {...}] \
help
to view the parameters.help
to view the launching parameters.help
, man
, man ${action}
, man ${resource}
, man ${resource} ${action}
to check the command manual. Also you can use System: help
to check the system commands.System:
to run some system commands, You may create http-controller
s and resp-controller
s. Then you can operate the vproxy instance using curl
or redis-cli
. You may also operate the vproxy instance directly using standard input (stdin).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 those who had committed PR, see CONTRIB.
The CDN acceleration and security protection of this project are sponsored by Tencent EdgeOne.
本项目 CDN 加速及安全防护由 Tencent EdgeOne 赞助