Documentation ¶
Index ¶
- type ApiKey
- type KikConnectionHolder
- type Server
- type ServerConfig
- func (s *ServerConfig) Start() *Server
- func (s *ServerConfig) WithAntiSpam() *ServerConfig
- func (s *ServerConfig) WithAntiSpamFunc(f func(k *node.InitialStreamTag) bool) *ServerConfig
- func (s *ServerConfig) WithApiKey(apiKey string) *ServerConfig
- func (s *ServerConfig) WithBanHosts() *ServerConfig
- func (s *ServerConfig) WithCustomBanner() *ServerConfig
- func (s *ServerConfig) WithCustomDialer(...) *ServerConfig
- func (s *ServerConfig) WithInitStreamTagGenerator(f func(k *node.InitialStreamTag) string) *ServerConfig
- func (s *ServerConfig) WithInterface(iface net.Interface, allowedIps []string) *ServerConfig
- func (s *ServerConfig) WithWhitelist(whitelist []string) *ServerConfig
- func (s *ServerConfig) WithXmppLogging() *ServerConfig
- func (s *ServerConfig) WithXmppLoggingFunc(f func(k *node.InitialStreamTag) bool) *ServerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiKey ¶
type ApiKey []byte
type KikConnectionHolder ¶
type KikConnectionHolder struct {
// contains filtered or unexported fields
}
I'm struggling to think of a better name. Suggest me one.
func NewConnectionHolder ¶
func NewConnectionHolder() *KikConnectionHolder
func (*KikConnectionHolder) DisconnectAll ¶
func (c *KikConnectionHolder) DisconnectAll()
Disconnects all clients
func (*KikConnectionHolder) DisconnectIp ¶
func (c *KikConnectionHolder) DisconnectIp(ip string)
Disconnects all clients under a given IP address.
type ServerConfig ¶
type ServerConfig struct {
// contains filtered or unexported fields
}
func NewInsecure ¶
func NewInsecure(port int) *ServerConfig
New builder for a server that will open a plain text connection on the given port.
func NewTLS ¶
func NewTLS(port int, config *tls.Config) *ServerConfig
New builder for a server that will open a TLS (secure) connection on the given port with the given config.
func (*ServerConfig) Start ¶
func (s *ServerConfig) Start() *Server
Starts the server. Call Server.Await() to block, which is required for CLI.
func (*ServerConfig) WithAntiSpam ¶
func (s *ServerConfig) WithAntiSpam() *ServerConfig
All clients will be protected by rate limiting. If a peer sends too many messages to the client, the server will intercept and delete them.
func (*ServerConfig) WithAntiSpamFunc ¶
func (s *ServerConfig) WithAntiSpamFunc(f func(k *node.InitialStreamTag) bool) *ServerConfig
All clients matching f will be protected by rate limiting. If a peer sends too many messages to the client, the server will intercept and delete them.
func (*ServerConfig) WithApiKey ¶
func (s *ServerConfig) WithApiKey(apiKey string) *ServerConfig
When specified, only whitelisted accounts and clients that authenticate with the 'x-api-key' header matching the apiKey will be allowed to connect.
func (*ServerConfig) WithBanHosts ¶
func (s *ServerConfig) WithBanHosts() *ServerConfig
Hosts will be banned using iptables if they send malformed packets, fail integrity checks or are IP scrapers
func (*ServerConfig) WithCustomBanner ¶
func (s *ServerConfig) WithCustomBanner() *ServerConfig
Server will include a banner in the stream header upon successful authentication.
func (*ServerConfig) WithCustomDialer ¶
func (s *ServerConfig) WithCustomDialer(f func(k *node.InitialStreamTag, dialer *net.Dialer, network string, addr string, config *tls.Config) (*tls.Conn, error)) *ServerConfig
Server will use your custom dialer to connect to Kik.
dialer, network, addr, and config can be used to call tls.DialWithDialer.
func (*ServerConfig) WithInitStreamTagGenerator ¶
func (s *ServerConfig) WithInitStreamTagGenerator(f func(k *node.InitialStreamTag) string) *ServerConfig
Server will use your custom dialer to connect to Kik.
dialer, network, addr, and config can be used to call tls.DialWithDialer.
func (*ServerConfig) WithInterface ¶
func (s *ServerConfig) WithInterface(iface net.Interface, allowedIps []string) *ServerConfig
Use a custom network interface to dial to Kik. allowedIps is the list of IPs that clients are allowed to use via the 'x-interface' stream header. Set to nil to allow all addresses under the iface.
func (*ServerConfig) WithWhitelist ¶
func (s *ServerConfig) WithWhitelist(whitelist []string) *ServerConfig
JIDs / device IDs on this list aren't subject to API key restrictions.
func (*ServerConfig) WithXmppLogging ¶
func (s *ServerConfig) WithXmppLogging() *ServerConfig
Server logs all XMPP sent and received to the 'xmpp' directory.
func (*ServerConfig) WithXmppLoggingFunc ¶
func (s *ServerConfig) WithXmppLoggingFunc(f func(k *node.InitialStreamTag) bool) *ServerConfig
Server logs all XMPP sent and received to the 'xmpp' directory for all clients matching f