replace whole default client

This commit is contained in:
idk
2022-09-29 01:32:37 -04:00
parent 69a43a07bb
commit 8ac67bd757

14
main.go
View File

@ -15,6 +15,7 @@ import (
"cerca/util"
"github.com/eyedeekay/about.i2p/about"
"github.com/eyedeekay/goSam"
"github.com/eyedeekay/onramp"
)
@ -85,11 +86,20 @@ func main() {
panic(err)
}
defer garlic.Close()
http.DefaultClient = &http.Client{
sam, err := goSam.NewDefaultClient()
if err != nil {
panic(err)
}
log.Println("Client Created")
// create a transport that uses SAM to dial TCP Connections
http.DefaultClient := &http.Client{
Transport: &http.Transport{
Dial: garlic.Dial,
Dial: sam.Dial,
},
}
allowList := readAllowlist(allowlistLocation)
allowList = append(allowList, "*.i2p")
allowList = append(allowList, "*.b32.i2p")