|
|
|
@ -83,7 +83,7 @@ func parseConfig(configPath string) (configuration, error) {
|
|
|
|
|
|
|
|
|
|
// Read config file per line.
|
|
|
|
|
for scanner.Scan() {
|
|
|
|
|
if strings.HasPrefix(scanner.Text(), "#"){
|
|
|
|
|
if strings.HasPrefix(scanner.Text(), "#") {
|
|
|
|
|
continue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -100,7 +100,7 @@ func parseConfig(configPath string) (configuration, error) {
|
|
|
|
|
output.port = row[1]
|
|
|
|
|
default:
|
|
|
|
|
if len(row) >= 2 {
|
|
|
|
|
if strings.Contains(scanner.Text(), ";"){
|
|
|
|
|
if strings.Contains(scanner.Text(), ";") {
|
|
|
|
|
output.username = strings.Split(row[0], ";")[0]
|
|
|
|
|
output.jserver = strings.Split(row[0], ";")[1]
|
|
|
|
|
output.password = row[1]
|
|
|
|
@ -238,15 +238,21 @@ func main() {
|
|
|
|
|
password = *flagPassword
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Use ALPN
|
|
|
|
|
tlsConfig := xmpp.DefaultConfig
|
|
|
|
|
tlsConfig.ServerName = strings.Split(server, ":")[0]
|
|
|
|
|
tlsConfig.NextProtos = append(tlsConfig.NextProtos, "xmpp-client")
|
|
|
|
|
|
|
|
|
|
// Set XMPP connection options.
|
|
|
|
|
options := xmpp.Options{
|
|
|
|
|
Host: server,
|
|
|
|
|
User: user,
|
|
|
|
|
Resource: *flagResource,
|
|
|
|
|
Password: password,
|
|
|
|
|
NoTLS: !*flagTLS,
|
|
|
|
|
StartTLS: *flagStartTLS,
|
|
|
|
|
Debug: *flagDebug,
|
|
|
|
|
Host: server,
|
|
|
|
|
User: user,
|
|
|
|
|
Resource: *flagResource,
|
|
|
|
|
Password: password,
|
|
|
|
|
NoTLS: !*flagTLS,
|
|
|
|
|
StartTLS: *flagStartTLS,
|
|
|
|
|
Debug: *flagDebug,
|
|
|
|
|
TLSConfig: &tlsConfig,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Read message from file.
|
|
|
|
|