examples/chat: Use new listen/dial API
This commit is contained in:
@@ -47,13 +47,10 @@ func main() {
|
||||
func join(address string, room string, nickname string) (hopp.Trans, error) {
|
||||
ctx, done := context.WithTimeout(context.Background(), 16 * time.Second)
|
||||
defer done()
|
||||
dialer := hopp.Dialer {
|
||||
TLSConfig: &tls.Config {
|
||||
// don't actually do this in real life
|
||||
InsecureSkipVerify: true,
|
||||
},
|
||||
}
|
||||
conn, err := dialer.Dial(ctx, "tcp", address)
|
||||
conn, err := hopp.Dial(ctx, "tls", address, &tls.Config {
|
||||
// don't actually do this in real life
|
||||
InsecureSkipVerify: true,
|
||||
})
|
||||
if err != nil { return nil, err }
|
||||
|
||||
transRoom, err := conn.OpenTrans()
|
||||
|
||||
Reference in New Issue
Block a user