proxy: add http logging
This commit is contained in:
parent
c42dfc80b8
commit
442e0df3a6
@ -4,12 +4,12 @@ LABEL Lan Tian "lantian@lantian.pub"
|
||||
ENV GOOS=linux GOARCH=amd64
|
||||
WORKDIR /root
|
||||
COPY . .
|
||||
RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -qq install -y golang traceroute locales busybox \
|
||||
&& cd /root && go build -o /proxy \
|
||||
RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -qq install -y golang git traceroute locales busybox \
|
||||
&& cd /root && go get github.com/gorilla/handlers && go build -o /proxy \
|
||||
&& cd / && rm -rf /root/* \
|
||||
&& printf "en_US.UTF-8 UTF-8\nzh_CN.UTF-8 UTF-8\n" > /etc/locale.gen \
|
||||
&& locale-gen \
|
||||
&& apt-get -qq purge -y golang \
|
||||
&& apt-get -qq purge -y golang git \
|
||||
&& apt-get -qq autoremove --purge -y && apt-get clean && rm -rf /var/lib/apt/lists
|
||||
|
||||
ENTRYPOINT ["/proxy"]
|
||||
|
@ -4,12 +4,12 @@ LABEL Lan Tian "lantian@lantian.pub"
|
||||
ENV GOOS=linux GOARCH=arm
|
||||
WORKDIR /root
|
||||
COPY . .
|
||||
RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -qq install -y golang traceroute locales busybox \
|
||||
&& cd /root && go build -o /proxy \
|
||||
RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -qq install -y golang git traceroute locales busybox \
|
||||
&& cd /root && go get github.com/gorilla/handlers && go build -o /proxy \
|
||||
&& cd / && rm -rf /root/* \
|
||||
&& printf "en_US.UTF-8 UTF-8\nzh_CN.UTF-8 UTF-8\n" > /etc/locale.gen \
|
||||
&& locale-gen \
|
||||
&& apt-get -qq purge -y golang \
|
||||
&& apt-get -qq purge -y golang git \
|
||||
&& apt-get -qq autoremove --purge -y && apt-get clean && rm -rf /var/lib/apt/lists
|
||||
|
||||
ENTRYPOINT ["/proxy"]
|
||||
|
@ -4,12 +4,12 @@ LABEL Lan Tian "lantian@lantian.pub"
|
||||
ENV GOOS=linux GOARCH=arm64
|
||||
WORKDIR /root
|
||||
COPY . .
|
||||
RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -qq install -y golang traceroute locales busybox \
|
||||
&& cd /root && go build -o /proxy \
|
||||
RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -qq install -y golang git traceroute locales busybox \
|
||||
&& cd /root && go get github.com/gorilla/handlers && go build -o /proxy \
|
||||
&& cd / && rm -rf /root/* \
|
||||
&& printf "en_US.UTF-8 UTF-8\nzh_CN.UTF-8 UTF-8\n" > /etc/locale.gen \
|
||||
&& locale-gen \
|
||||
&& apt-get -qq purge -y golang \
|
||||
&& apt-get -qq purge -y golang git \
|
||||
&& apt-get -qq autoremove --purge -y && apt-get clean && rm -rf /var/lib/apt/lists
|
||||
|
||||
ENTRYPOINT ["/proxy"]
|
||||
|
@ -4,12 +4,12 @@ LABEL Lan Tian "lantian@lantian.pub"
|
||||
ENV GOOS=linux GOARCH=386
|
||||
WORKDIR /root
|
||||
COPY . .
|
||||
RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -qq install -y golang traceroute locales busybox \
|
||||
&& cd /root && go build -o /proxy \
|
||||
RUN apt-get -qq update && DEBIAN_FRONTEND=noninteractive apt-get -qq install -y golang git traceroute locales busybox \
|
||||
&& cd /root && go get github.com/gorilla/handlers && go build -o /proxy \
|
||||
&& cd / && rm -rf /root/* \
|
||||
&& printf "en_US.UTF-8 UTF-8\nzh_CN.UTF-8 UTF-8\n" > /etc/locale.gen \
|
||||
&& locale-gen \
|
||||
&& apt-get -qq purge -y golang \
|
||||
&& apt-get -qq purge -y golang git \
|
||||
&& apt-get -qq autoremove --purge -y && apt-get clean && rm -rf /var/lib/apt/lists
|
||||
|
||||
ENTRYPOINT ["/proxy"]
|
||||
|
@ -4,6 +4,8 @@ import (
|
||||
"flag"
|
||||
"net/http"
|
||||
"os"
|
||||
|
||||
"github.com/gorilla/handlers"
|
||||
)
|
||||
|
||||
// Check if a byte is character for number
|
||||
@ -60,5 +62,5 @@ func main() {
|
||||
http.HandleFunc("/bird6", bird6Handler)
|
||||
http.HandleFunc("/traceroute", tracerouteIPv4Wrapper)
|
||||
http.HandleFunc("/traceroute6", tracerouteIPv6Wrapper)
|
||||
http.ListenAndServe(*listenParam, nil)
|
||||
http.ListenAndServe(*listenParam, handlers.LoggingHandler(os.Stdout, http.DefaultServeMux))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user