feat(vpn服务器): VPN 服务器的简单实现

WebSocket的数据写入网卡,将网卡读取的数据写入WebSocket
This commit is contained in:
lqyan
2024-11-15 23:03:26 +08:00
parent 0fde21c0ec
commit 923c68a2ea
6 changed files with 82 additions and 26 deletions

View File

@@ -1,13 +1,20 @@
from docker.yuchat.top/golang:1.21-alpine AS builder
workdir /app
COPY . .
RUN go mod tidy && go build -o yuchat-proxy-server server/main.go
RUN echo "nameserver 114.114.114.114" > /etc/resolv.conf
RUN apk add --no-cache \
libpcap-dev \
build-base
RUN go mod tidy
RUN go build -o yuchat-proxy-server server/main.go
from docker.yuchat.top/alpine:3.11
workdir /app
expose 8080
RUN echo "nameserver 114.114.114.114" > /etc/resolv.conf
RUN apk add --no-cache libpcap
copy --from=builder /app/yuchat-proxy-server /app/yuchat-proxy-server
entrypoint ["./yuchat-proxy-server"]