9 "github.com/layeh/barnard"
10 "github.com/layeh/barnard/uiterm"
11 "github.com/layeh/gumble/gumble"
12 "github.com/layeh/gumble/gumbleutil"
13 "github.com/layeh/gumble/gumble_openal"
18 server := flag.String("server", "localhost:64738", "the server to connect to")
19 username := flag.String("username", "", "the username of the client")
20 insecure := flag.Bool("insecure", false, "skip server certificate verification")
21 certificate := flag.String("certificate", "", "PEM encoded certificate and private key")
26 b := barnard.Barnard{}
30 b.Config = gumble.NewConfig()
31 b.Config.Username = *username
32 b.Config.Address = *server
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)
46 b.Client.Attach(gumbleutil.AutoBitrate)
49 if os.Getenv("ALSOFT_LOGLEVEL") == "" {
50 os.Setenv("ALSOFT_LOGLEVEL", "0")
52 if stream, err := gumble_openal.New(b.Client); err != nil {
53 fmt.Fprintf(os.Stderr, "%s\n", err)
59 if err := b.Client.Connect(); err != nil {
60 fmt.Fprintf(os.Stderr, "%s\n", err)