Add openvpn and openconnect

This commit is contained in:
世界
2026-08-30 17:41:43 +08:00
parent 23ca3b415f
commit 2df7a9bac7
65 changed files with 12495 additions and 386 deletions
+11
View File
@@ -0,0 +1,11 @@
FROM debian:trixie-slim@sha256:cedb1ef40439206b673ee8b33a46a03a0c9fa90bf3732f54704f99cb061d2c5a
ARG OCSERV_VERSION=1.3.0-2
RUN apt-get update \
&& apt-get install --yes --no-install-recommends ocserv="${OCSERV_VERSION}" iproute2 python3 \
&& rm -rf /var/lib/apt/lists/*
COPY echo_server.py /usr/local/bin/openconnect-echo-server
EXPOSE 443/tcp 443/udp
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env python3
import socket
import threading
def echo(connection):
with connection:
while True:
data = connection.recv(65536)
if not data:
return
connection.sendall(data)
listener = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
listener.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
listener.bind(("0.0.0.0", 18080))
listener.listen()
print("openconnect echo ready", flush=True)
while True:
accepted, _ = listener.accept()
threading.Thread(target=echo, args=(accepted,), daemon=True).start()