mirror of
https://github.com/whyvl/wireproxy.git
synced 2025-04-29 19:01:42 +02:00
fix linting
This commit is contained in:
parent
efc7e62704
commit
bf46e5a3da
1 changed files with 5 additions and 4 deletions
|
@ -3,6 +3,7 @@ package wireproxy
|
|||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
srand "crypto/rand"
|
||||
"crypto/subtle"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue