Ircxd.Server (ircxd v1.1.0)

Copy Markdown View Source

Provides an embeddable IRC server.

Use start_link/1 or add this module to a supervision tree. Each server owns one listener and its client connections.

Summary

Functions

Returns a child specification with the same options as start_link/1.

Runs a state operation through the configured server adapter.

Returns the active listener port.

Runs a read-only query through the configured server adapter.

Starts an IRC server.

Functions

child_spec(init_arg)

Returns a child specification with the same options as start_link/1.

execute(server, operation)

Runs a state operation through the configured server adapter.

The built-in ETS adapter accepts {:put_channel, name, attributes} and {:put_channel_roles, channel, account, roles}.

Returns {:error, :adapter_not_configured} if the server has no adapter.

port(server)

Returns the active listener port.

query(server, query)

Runs a read-only query through the configured server adapter.

The built-in ETS adapter accepts :users, :channels, {:channel, name}, {:channels_for, nick}, {:channel_roles, channel, account}, and {:messages, target, options}. The message options accept :limit, which defaults to 50.

Returns {:error, :adapter_not_configured} if the server has no adapter.

start_link(opts)

Starts an IRC server.

This function accepts these options:

  • :port - Sets the listener port. The default is 6667. Use 0 to select an available port.
  • :ip - Sets the listener address. The default is {127, 0, 0, 1}.
  • :server_name - Sets the IRC server name. The default is "ircxd.local".
  • :name - Registers the server process with a name.
  • :id - Sets the child ID and the adapter server ID.
  • :tls - Enables implicit TLS. The default is false.
  • :tls_options - Sets the Erlang TLS listener options.
  • :password - Requires a server password during registration.
  • :allow_insecure_auth - Permits credentials on TCP. The default is false.
  • :external_auth - Enables SASL EXTERNAL with peer certificates.
  • :adapter - Sets an {adapter_module, init_arg} pair.
  • :authentication_timeout - Sets the adapter authentication timeout.
  • :registration_timeout - Sets the client registration timeout.
  • :handshake_timeout - Sets the TLS handshake timeout.
  • :max_handshakes - Sets the maximum number of concurrent TLS handshakes.
  • :max_connections - Sets the maximum number of client connections.
  • :command_rate_limit - Sets the command limit for each one-second window.
  • :history_limit - Sets the maximum in-memory message count.
  • :motd - Sets the message-of-the-day lines.
  • :info - Sets the server information lines.
  • :help - Sets the server help map.
  • :isupport - Sets the advertised ISUPPORT tokens.
  • :admin - Sets the server administrator information.