go-xmpp/_examples/xmpp_chat_client
rcorniere 8798ff6fc1 - Changed IQ stanzas to pointer semantics
- Fixed commands from v 0.4.0 and tests
- Added primitive Result Sets support (XEP-0059)
2020-01-31 11:48:03 +01:00
..
config.yml Changed "Disconnect" to wait for the closing stream tag. (#141) 2019-12-26 14:47:02 +01:00
go.mod - Changed IQ stanzas to pointer semantics 2020-01-31 11:48:03 +01:00
interface.go PubSub protocol support (#142) 2020-01-09 15:33:11 +01:00
README.md Changed "Disconnect" to wait for the closing stream tag. (#141) 2019-12-26 14:47:02 +01:00
xmpp_chat_client.go - Changed IQ stanzas to pointer semantics 2020-01-31 11:48:03 +01:00

Chat TUI example

This is a simple chat example, with a TUI.
It shows the library usage and a few of its capabilities.

How to run

Build

You can build the client using :

    go build -o example_client

and then run with (on unix for example):

    ./example_client

or you can simply build + run in one command while at the example directory root, like this:

    go run xmpp_chat_client.go interface.go 

Configuration

The example needs a configuration file to run. A sample file is provided.
By default, the example will look for a file named "config" in the current directory. To provide a different configuration file, pass the following argument to the example :

    go run xmpp_chat_client.go interface.go -c /path/to/config

where /path/to/config is the path to the directory containing the configuration file. The configuration file must be named "config" and be using the yaml format.

Required fields are :

Server :
  - full_address: "localhost:5222"
Client : # This is you
  - jid: "testuser2@localhost"
  - pass: "pass123" #Password in a config file yay

# Contacts list, ";" separated
Contacts : "testuser1@localhost;testuser3@localhost"
# Should we log stanzas ?  
LogStanzas:
  - logger_on: "true"
  - logfile_path: "./logs" # Path to directory, not file.

How to use

Shortcuts :
- ctrl+space : switch between input window and menu window.
- While in input window :
- enter : sends a message if in message mode (see menu options)
- ctrl+e : sends a raw stanza when in raw mode (see menu options)
- ctrl+c : quit