https://github.com/joehonkey/msg2irc
Lightweight HTTP-to-IRC bridge. Send messages to IRC channels and users via HTTP POST.
https://github.com/joehonkey/msg2irc
golang irc irc-bot ircv3 self-hosted webhook
Last synced: 29 days ago
JSON representation
Lightweight HTTP-to-IRC bridge. Send messages to IRC channels and users via HTTP POST.
- Host: GitHub
- URL: https://github.com/joehonkey/msg2irc
- Owner: joehonkey
- Created: 2026-05-14T02:21:08.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2026-05-14T02:52:26.000Z (about 1 month ago)
- Last Synced: 2026-05-14T04:41:34.835Z (about 1 month ago)
- Topics: golang, irc, irc-bot, ircv3, self-hosted, webhook
- Language: Go
- Size: 6.14 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# msg2irc
[](https://opensource.org/licenses/MIT)
[](https://golang.org)
HTTP-to-IRC bridge. POST a JSON payload, it shows up as a PRIVMSG.
Runs as a persistent IRC bot on your server. Put it behind a reverse proxy and you can hit it from anywhere — phone shortcuts, monitoring alerts, scripts, webhooks.
---
## How it works

---
## Build
```bash
git clone https://github.com/joehonkey/msg2irc
cd msg2irc
go build -o msg2irc .
```
FreeBSD cross-compile:
```bash
GOOS=freebsd GOARCH=amd64 go build -o msg2irc .
```
---
## Configuration
```yaml
listen_addr: "127.0.0.1:8080"
token: "your-secret-token"
tls:
mode: "off" # off | auto | manual
domain: ""
cert: ""
key: ""
listen_addr: ":443"
cache_dir: "./certs"
irc:
server: "irc.example.com"
port: 6697
nick: "msg2irc"
tls: true
tls_hostname: "irc.example.com"
channels:
- "#yourchannel"
```
### TLS modes
| Mode | Description |
|------|-------------|
| `off` | Plain HTTP on `listen_addr`. Reverse proxy handles HTTPS. |
| `auto` | Let's Encrypt. Needs ports 80 and 443. |
| `manual` | Your own cert and key files. |
---
## Running
```bash
./msg2irc -config config.yaml
```
FreeBSD rc.d:
```bash
sudo cp contrib/freebsd/msg2irc /usr/local/etc/rc.d/msg2irc
sudo sysrc msg2irc_enable=YES
sudo service msg2irc start
```
---
## Sending a message
```bash
curl -X POST https://your-server.example.com/msg2irc/send \
-H "Content-Type: application/json" \
-d '{"target":"#chan","message":"hello","token":"your-secret-token"}'
```
| Field | Required | Notes |
|-------|----------|-------|
| `target` | yes | `#channel` or nick |
| `message` | yes | Text to send |
| `from` | no | Prefixed as `from: message` |
| `token` | yes | Must match config |
---
## Reverse proxy
**Apache** — inside your HTTPS VirtualHost:
```apache
ProxyPass "/msg2irc/" "http://127.0.0.1:8080/"
ProxyPassReverse "/msg2irc/" "http://127.0.0.1:8080/"
Require all granted
```
**nginx:**
```nginx
location /msg2irc/ {
proxy_pass http://127.0.0.1:8080/;
}
```
---
## Phone
[HTTP Shortcuts](https://http-shortcuts.rmy.ch/) (Android) works well. Set up a POST shortcut, add a `message` variable with type **Text Input**, and you get a prompt each time you tap it.
---
## Security
Keep `token` secret — it's the only thing protecting the endpoint. Always run behind HTTPS. If using a proxy, bind `listen_addr` to `127.0.0.1`.
---
## License
MIT