Chore: add some linters and clean up the code
This commit is contained in:
@ -76,7 +76,7 @@ func (vc *Conn) sendRequest() error {
|
||||
|
||||
p := mathRand.Intn(16)
|
||||
// P Sec Reserve Cmd
|
||||
buf.WriteByte(byte(p<<4) | byte(vc.security))
|
||||
buf.WriteByte(byte(p<<4) | vc.security)
|
||||
buf.WriteByte(0)
|
||||
if vc.dst.UDP {
|
||||
buf.WriteByte(CommandUDP)
|
||||
|
@ -30,7 +30,7 @@ func (hc *h2Conn) establishConn() error {
|
||||
path := hc.cfg.Path
|
||||
// TODO: connect use VMess Host instead of H2 Host
|
||||
req := http.Request{
|
||||
Method: "PUT",
|
||||
Method: http.MethodPut,
|
||||
Host: host,
|
||||
URL: &url.URL{
|
||||
Scheme: "https",
|
||||
|
@ -58,7 +58,7 @@ func (hc *httpConn) Write(b []byte) (int, error) {
|
||||
}
|
||||
|
||||
u := fmt.Sprintf("http://%s%s", host, path)
|
||||
req, _ := http.NewRequest("GET", u, bytes.NewBuffer(b))
|
||||
req, _ := http.NewRequest(http.MethodGet, u, bytes.NewBuffer(b))
|
||||
for key, list := range hc.cfg.Headers {
|
||||
req.Header.Set(key, list[rand.Intn(len(list))])
|
||||
}
|
||||
|
Reference in New Issue
Block a user