// SPDX-FileCopyrightText: V <v@anomalous.eu>
// SPDX-FileCopyrightText: edef <edef@edef.eu>
// SPDX-License-Identifier: OSL-3.0

= loxy

...a __lo__gging IRC pr__oxy__.

It sits between your IRC client and the IRC servers you connect to, and saves timestamped raw IRC protocol lines to an SQLite database.
It is implemented as an HTTP proxy server, making it compatible with most modern IRC clients.

It supports systemd socket activation.

== Configuration

Note: since loxy is a transparent proxy, you must ensure your client is set to use insecure connections.
loxy will only make secure outgoing connections.
All outgoing connections are currently made to the hardcoded port 6697.

=== Irssi

If your servers are configured to use TLS,footnote:[as they should be!] you will need to either recreate them without it enabled, or remove the `use_tls` flag in your `~/.irssi/config`, since it does not support removing TLS with `/SERVER MODIFY`.

[source,irssi]
/SET use_proxy ON
/SET proxy_address <loxy host>
/SET proxy_port <loxy port>
/SET -clear proxy_password
/EVAL SET proxy_string CONNECT %s HTTP/1.0\n\n

=== Quassel

In the network configuration dialogue, for each server in the 'Servers' tab, select 'Edit...'.
Under the 'Server Info' tab, ensure that the 'Use encrypted connection' option is disabled.
Under the 'Advanced' tab, select 'Use a Proxy', set the type to 'HTTP', and fill in the host and port as appropriate.
For an instance of loxy running on the same machine with default options, 'localhost' and '3893' should be good.

== Files

* `listener.go` - listener gathering
* `main.go` - program entry point
* `proxy.go` - IRC protocol parsing and proxy server
* `session.go` - encapsulates a 'session', buffering writes
* `store.go` - database schema and routines

== Caveats

* doesn't support insecure connections
* doesn't support invalid certificates (self-signed, expired, etc)
* only supports one client certificate per instance
* doesn't support SOCKS, only the HTTP proxy protocol

== TODO

* make loxy serve its own source code over HTTP
* inject server notices (or numerics) into the proxied connection, to provide license notices and source code links
* eliminate the caveats

== License

loxy is licensed under the Open Software License, version 3.0.

If you let other people use your loxy instance, you're in charge of fulfilling the license requirements.
This includes (but is not limited to) informing them of the license and making source code available to them.
