Skip to content
This repository was archived by the owner on Feb 17, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ WORKDIR /app
COPY --from=build-env /src/proxy /app/
ENV SOCKS_USER=user
ENV SOCKS_PASSWORD=password
ENV PROXY_PORT=1080
CMD ["./proxy"]
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ func main() {
if err != nil {
panic(err)
}
if err := server.ListenAndServe("tcp", "0.0.0.0:1080"); err != nil {
port := os.Getenv("PROXY_PORT")
if port == "" {
port = "1080"
}
if err := server.ListenAndServe("tcp", "0.0.0.0:" + port); err != nil {
panic(err)
}
}