My mirror of the Barnard terminal client for Mumble.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

48 lignes
1.0 KiB

  1. package main
  2. import (
  3. "crypto/tls"
  4. "flag"
  5. "fmt"
  6. "os"
  7. "layeh.com/barnard/uiterm"
  8. "layeh.com/gumble/gumble"
  9. _ "layeh.com/gumble/opus"
  10. )
  11. func main() {
  12. // Command line flags
  13. server := flag.String("server", "localhost:64738", "the server to connect to")
  14. username := flag.String("username", "", "the username of the client")
  15. password := flag.String("password", "", "the password of the server")
  16. insecure := flag.Bool("insecure", false, "skip server certificate verification")
  17. certificate := flag.String("certificate", "", "PEM encoded certificate and private key")
  18. flag.Parse()
  19. // Initialize
  20. b := Barnard{
  21. Config: gumble.NewConfig(),
  22. Address: *server,
  23. }
  24. b.Config.Username = *username
  25. b.Config.Password = *password
  26. if *insecure {
  27. b.TLSConfig.InsecureSkipVerify = true
  28. }
  29. if *certificate != "" {
  30. cert, err := tls.LoadX509KeyPair(*certificate, *certificate)
  31. if err != nil {
  32. fmt.Fprintf(os.Stderr, "%s\n", err)
  33. os.Exit(1)
  34. }
  35. b.TLSConfig.Certificates = append(b.TLSConfig.Certificates, cert)
  36. }
  37. b.Ui = uiterm.New(&b)
  38. b.Ui.Run()
  39. }