Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
pufferffish committed Apr 11, 2024
1 parent efc7e62 commit bf46e5a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions routine.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package wireproxy
import (
"bytes"
"context"
srand "crypto/rand"
"crypto/subtle"
"encoding/json"
"errors"
Expand Down Expand Up @@ -161,16 +162,16 @@ func (config *Socks5Config) SpawnRoutine(vt *VirtualTun) {

// SpawnRoutine spawns a http server.
func (config *HTTPConfig) SpawnRoutine(vt *VirtualTun) {
http := &HTTPServer{
server := &HTTPServer{
config: config,
dial: vt.Tnet.Dial,
auth: CredentialValidator{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)
}
}
Expand Down Expand Up @@ -407,7 +408,7 @@ func (d VirtualTun) pingIPs() {
}

data := make([]byte, 16)
rand.Read(data)
_, _ = srand.Read(data)

requestPing := icmp.Echo{
Seq: rand.Intn(1 << 16),
Expand Down

0 comments on commit bf46e5a

Please sign in to comment.