2016-11-03 21:13:18 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
"net"
|
|
|
|
"net/http"
|
|
|
|
"os"
|
|
|
|
|
|
|
|
"github.com/bifurcation/mint"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2016-11-30 01:00:17 +00:00
|
|
|
c := &mint.Config{
|
|
|
|
PSKs: &mint.PSKMapCache{},
|
|
|
|
}
|
|
|
|
|
2016-11-03 21:13:18 +00:00
|
|
|
tr := &http.Transport{
|
|
|
|
DialTLS: func(network, addr string) (net.Conn, error) {
|
2016-11-30 01:00:17 +00:00
|
|
|
return mint.Dial(network, addr, c)
|
2016-11-03 21:13:18 +00:00
|
|
|
},
|
2016-11-21 22:25:27 +00:00
|
|
|
DisableKeepAlives: true,
|
2016-11-03 21:13:18 +00:00
|
|
|
}
|
|
|
|
client := &http.Client{Transport: tr}
|
2016-11-21 22:25:27 +00:00
|
|
|
|
2016-11-03 21:13:18 +00:00
|
|
|
resp, err := client.Get("https://" + os.Args[1])
|
|
|
|
if err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
|
|
|
if err := resp.Write(os.Stdout); err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
2016-11-21 22:25:27 +00:00
|
|
|
|
|
|
|
// Resumption
|
|
|
|
resp, err = client.Get("https://" + os.Args[1])
|
|
|
|
if err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
|
|
|
if err := resp.Write(os.Stdout); err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
2016-11-03 21:13:18 +00:00
|
|
|
}
|