examples/chat: Use new listen/dial API

This commit is contained in:
2025-10-20 17:59:51 -04:00
parent c9480ba016
commit 2e4c693174
2 changed files with 6 additions and 9 deletions

View File

@@ -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()