example/interact.go
changeset 130 da6f37ae3ffe
parent 125 f464f14e39a7
child 137 c94a7ce0f4fb
--- a/example/interact.go	Sat Sep 07 11:46:42 2013 -0700
+++ b/example/interact.go	Sat Sep 07 14:43:54 2013 -0700
@@ -5,7 +5,7 @@
 package main
 
 import (
-	xmpp ".."
+	"../xmpp"
 	"crypto/tls"
 	"encoding/xml"
 	"flag"
@@ -31,8 +31,6 @@
 	// xmpp.Debug = logger
 	xmpp.Info = logger
 	xmpp.Warn = logger
-
-	xmpp.TlsConfig = tls.Config{InsecureSkipVerify: true}
 }
 
 // Demonstrate the API, and allow the user to interact with an XMPP
@@ -47,11 +45,12 @@
 		os.Exit(2)
 	}
 
-	c, err := xmpp.NewClient(&jid, *pw, nil)
+	tlsConf := tls.Config{InsecureSkipVerify: true}
+	c, err := xmpp.NewClient(&jid, *pw, tlsConf, nil)
 	if err != nil {
 		log.Fatalf("NewClient(%v): %v", jid, err)
 	}
-	defer close(c.Out)
+	defer close(c.Send)
 
 	err = c.StartSession(&xmpp.Presence{})
 	if err != nil {
@@ -69,7 +68,7 @@
 			fmt.Printf("s: %v\n", obj)
 		}
 		fmt.Println("done reading")
-	}(c.In)
+	}(c.Recv)
 
 	p := make([]byte, 1024)
 	for {
@@ -104,7 +103,7 @@
 		}
 		err = dec.Decode(stan)
 		if err == nil {
-			c.Out <- stan
+			c.Send <- stan
 		} else {
 			fmt.Printf("Parse error: %v\n", err)
 			break