mirror of
https://github.com/nadoo/glider.git
synced 2025-02-23 01:15:41 +08:00
http: better logging
This commit is contained in:
parent
0e89d1879f
commit
b3b11b4188
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@ -13,6 +13,8 @@ jobs:
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: 1.15.x
|
||||
- name: Go Env
|
||||
run: go env
|
||||
- name: Test
|
||||
run: go test -v .
|
||||
|
||||
@ -27,5 +29,7 @@ jobs:
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: 1.15.x
|
||||
- name: Go Env
|
||||
run: go env
|
||||
- name: Build
|
||||
run: go build -v .
|
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@ -17,6 +17,8 @@ jobs:
|
||||
uses: actions/setup-go@v1
|
||||
with:
|
||||
go-version: 1.15.x
|
||||
- name: Go Env
|
||||
run: go env
|
||||
- name: Run GoReleaser
|
||||
uses: goreleaser/goreleaser-action@v2
|
||||
with:
|
||||
|
10
main.go
10
main.go
@ -1,10 +1,8 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
stdlog "log"
|
||||
"net"
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
@ -36,7 +34,7 @@ import (
|
||||
_ "github.com/nadoo/glider/proxy/ws"
|
||||
)
|
||||
|
||||
var version = "0.10.3"
|
||||
var version = "0.10.4"
|
||||
|
||||
func main() {
|
||||
// read configs
|
||||
@ -78,12 +76,6 @@ func main() {
|
||||
}
|
||||
|
||||
d.Start()
|
||||
|
||||
net.DefaultResolver.PreferGo = true
|
||||
net.DefaultResolver.Dial = func(ctx context.Context, network, address string) (net.Conn, error) {
|
||||
d := net.Dialer{}
|
||||
return d.DialContext(ctx, "udp", conf.DNS)
|
||||
}
|
||||
}
|
||||
|
||||
// enable checkers
|
||||
|
@ -161,7 +161,7 @@ func (s *HTTP) servHTTP(req *request, c *conn.Conn) {
|
||||
writeStartLine(buf, proto, code, status)
|
||||
writeHeaders(buf, header)
|
||||
|
||||
log.F("[http] %s <-> %s", c.RemoteAddr(), req.target)
|
||||
log.F("[http] %s <-> %s via %s", c.RemoteAddr(), req.target, dialer.Addr())
|
||||
c.Write(buf.Bytes())
|
||||
|
||||
conn.Copy(c, r)
|
||||
|
Loading…
Reference in New Issue
Block a user