fix linting

This commit is contained in:
pufferffish 2024-04-11 02:00:55 +01:00
parent efc7e62704
commit bf46e5a3da

View file

@ -3,6 +3,7 @@ package wireproxy
import ( import (
"bytes" "bytes"
"context" "context"
srand "crypto/rand"
"crypto/subtle" "crypto/subtle"
"encoding/json" "encoding/json"
"errors" "errors"
@ -161,16 +162,16 @@ func (config *Socks5Config) SpawnRoutine(vt *VirtualTun) {
// SpawnRoutine spawns a http server. // SpawnRoutine spawns a http server.
func (config *HTTPConfig) SpawnRoutine(vt *VirtualTun) { func (config *HTTPConfig) SpawnRoutine(vt *VirtualTun) {
http := &HTTPServer{ server := &HTTPServer{
config: config, config: config,
dial: vt.Tnet.Dial, dial: vt.Tnet.Dial,
auth: CredentialValidator{config.Username, config.Password}, auth: CredentialValidator{config.Username, config.Password},
} }
if config.Username != "" || config.Password != "" { if config.Username != "" || config.Password != "" {
http.authRequired = true server.authRequired = true
} }
if err := http.ListenAndServe("tcp", config.BindAddress); err != nil { if err := server.ListenAndServe("tcp", config.BindAddress); err != nil {
log.Fatal(err) log.Fatal(err)
} }
} }
@ -407,7 +408,7 @@ func (d VirtualTun) pingIPs() {
} }
data := make([]byte, 16) data := make([]byte, 16)
rand.Read(data) _, _ = srand.Read(data)
requestPing := icmp.Echo{ requestPing := icmp.Echo{
Seq: rand.Intn(1 << 16), Seq: rand.Intn(1 << 16),