mirror of
https://github.com/Alexey71/opera-proxy.git
synced 2026-05-14 06:30:59 +00:00
WIP
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
|
||||
se "github.com/Snawoot/opera-proxy/seclient"
|
||||
)
|
||||
|
||||
const (
|
||||
username = "se0316"
|
||||
password = "SILrMEPBmJuhomxWkfm3JalqHX2Eheg1YhlEZiMh8II"
|
||||
)
|
||||
|
||||
func main() {
|
||||
seclient, err := se.NewSEClient(username, password, nil)
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
log.Printf("seclient = %#v", seclient)
|
||||
|
||||
log.Println("------------ DOING REGISTRATION ------------")
|
||||
err = seclient.AnonRegister(context.TODO())
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
log.Printf("seclient = %#v", seclient)
|
||||
}
|
||||
@@ -168,8 +168,8 @@ func (c *SEClient) populateRequest(req *http.Request) {
|
||||
// Does cleanup of HTTP response in order to make it reusable by keep-alive
|
||||
// logic of HTTP client
|
||||
func cleanupBody(body io.ReadCloser) {
|
||||
io.Copy(io.Discard, io.LimitedReader{
|
||||
R: resp.Body,
|
||||
io.Copy(ioutil.Discard, &io.LimitedReader{
|
||||
R: body,
|
||||
N: READ_LIMIT,
|
||||
})
|
||||
body.Close()
|
||||
|
||||
Reference in New Issue
Block a user