■ ■ ■ ■ ■ ■
component/simple-obfs/http.go
| skipped 64 lines |
65 | 65 | | if ho.firstRequest { |
66 | 66 | | randBytes := make([]byte, 16) |
67 | 67 | | rand.Read(randBytes) |
68 | | - | req, _ := http.NewRequest("GET", fmt.Sprintf("http://%s/", ho.host), bytes.NewBuffer(b[:])) |
| 68 | + | req, _ := http.NewRequest(http.MethodGet, fmt.Sprintf("http://%s/", ho.host), bytes.NewBuffer(b[:])) |
69 | 69 | | req.Header.Set("User-Agent", fmt.Sprintf("curl/7.%d.%d", mRand.Int()%54, mRand.Int()%2)) |
70 | 70 | | req.Header.Set("Upgrade", "websocket") |
71 | 71 | | req.Header.Set("Connection", "Upgrade") |
| skipped 25 lines |