9 "github.com/layeh/barnard"
10 "github.com/layeh/barnard/uiterm"
11 "github.com/layeh/gumble/gumble"
12 "github.com/layeh/gumble/gumble_openal"
17 server := flag.String("server", "localhost:64738", "the server to connect to")
18 username := flag.String("username", "", "the username of the client")
19 insecure := flag.Bool("insecure", false, "skip server certificate verification")
20 certificate := flag.String("certificate", "", "PEM encoded certificate and private key")
25 b := barnard.Barnard{}
29 b.Config = gumble.Config{
34 b.Config.TLSConfig.InsecureSkipVerify = true
36 if *certificate != "" {
37 if cert, err := tls.LoadX509KeyPair(*certificate, *certificate); err != nil {
38 fmt.Fprintf(os.Stderr, "%s\n", err)
41 b.Config.TLSConfig.Certificates = []tls.Certificate{cert}
45 b.Client = gumble.NewClient(&b.Config)
48 if stream, err := gumble_openal.New(b.Client); err != nil {
49 fmt.Fprintf(os.Stderr, "%s\n", err)
55 if err := b.Client.Connect(); err != nil {
56 fmt.Fprintf(os.Stderr, "%s\n", err)