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"
14 _ "github.com/layeh/gumble/opus"
19 server := flag.String("server", "localhost:64738", "the server to connect to")
20 username := flag.String("username", "", "the username of the client")
21 insecure := flag.Bool("insecure", false, "skip server certificate verification")
22 certificate := flag.String("certificate", "", "PEM encoded certificate and private key")
27 b := barnard.Barnard{}
31 b.Config = gumble.NewConfig()
32 b.Config.Username = *username
33 b.Config.Address = *server
35 b.Config.TLSConfig.InsecureSkipVerify = true
37 if *certificate != "" {
38 if cert, err := tls.LoadX509KeyPair(*certificate, *certificate); err != nil {
39 fmt.Fprintf(os.Stderr, "%s\n", err)
42 b.Config.TLSConfig.Certificates = []tls.Certificate{cert}
46 b.Client = gumble.NewClient(b.Config)
47 b.Client.Attach(gumbleutil.AutoBitrate)
50 if os.Getenv("ALSOFT_LOGLEVEL") == "" {
51 os.Setenv("ALSOFT_LOGLEVEL", "0")
53 if stream, err := gumble_openal.New(b.Client); err != nil {
54 fmt.Fprintf(os.Stderr, "%s\n", err)
60 if err := b.Client.Connect(); err != nil {
61 fmt.Fprintf(os.Stderr, "%s\n", err)