Page 1 of 1
[SOLVED] Trying to get any websocket IRC client to work with UnrealIRCd
Posted: Tue Oct 15, 2024 4:34 am
by barryn
I have tried the example client at:
https://www.unrealircd.org/files/dev/ws ... lircd.html
I also tried KiwiIRC following the instructions at
https://www.unrealircd.org/docs/WebSocket_support. I know my IRC server is running because I can connect using other types of clients. I have verified the websocket port I am using is open. I added these lines to my unrealircd.conf:
Code: Select all
loadmodule "websocket";
loadmodule "webserver";
listen {
ip *;
port 8000;
options {
tls;
websocket { type text; } // type must be either 'text' or 'binary'
};
tls-options {
certificate "/home/irc/unrealircd/conf/tls/server.cert.pem";
key "/home/irc/unrealircd/conf/tls/server.key.pem";
options {
no-client-certificate;
};
};
};
The output from the server at startup and the output from netstat both show my server listening for connection on port 8000. The certificate is valid and I can connect to the IRC server using TLS, just not with any websocket client. Any ideas what could be wrong?
Re: Trying to get any websocket IRC client to work with UnrealIRCd
Posted: Tue Oct 15, 2024 4:35 am
by barryn
PS: The lounge works, but it has it's own proxy server.
Re: Trying to get any websocket IRC client to work with UnrealIRCd
Posted: Tue Oct 15, 2024 9:57 pm
by CrazyCat
Can you show your kiwiirc config.json ? Particularly the startupOptions block. And did you set disconnectOnSaslFail to false ?
Re: Trying to get any websocket IRC client to work with UnrealIRCd
Posted: Wed Oct 16, 2024 9:03 am
by barryn
My config.json
Code: Select all
"startupOptions" : {
"server": "redacted.redacted.com",
"port": 8000,
"tls": true,
"direct": true,
"channel": "#kiwiirc-default",
"nick": "kiwi-n?"
},
Where does disconnectOnSaslFail need to be set? I have not set it and I don't see that option in either config.json or unrealircd.conf? I don't recall this being mentioned in the instructions but maybe I missed it.
Re: Trying to get any websocket IRC client to work with UnrealIRCd
Posted: Wed Oct 16, 2024 9:08 am
by barryn
Here is the full config.json with the server name redacted.
Code: Select all
{
"windowTitle": "Kiwi IRC - The web IRC client",
"startupScreen": "welcome",
"kiwiServer": "https://redacted.redacted.com/kiwiirc",
"restricted": false,
"theme": "Default",
"themes": [
{ "name": "Default", "url": "static/themes/default" },
{ "name": "Dark", "url": "static/themes/dark" },
{ "name": "Coffee", "url": "static/themes/coffee" },
{ "name": "GrayFox", "url": "static/themes/grayfox" },
{ "name": "Nightswatch", "url": "static/themes/nightswatch" },
{ "name": "Osprey", "url": "static/themes/osprey" },
{ "name": "Radioactive", "url": "static/themes/radioactive" },
{ "name": "Sky", "url": "static/themes/sky" },
{ "name": "Elite", "url": "static/themes/elite" }
],
"startupOptions" : {
"server": "redacted.redacted.com",
"port": 8000,
"tls": true,
"direct": true,
"channel": "#kiwiirc-default",
"nick": "kiwi-n?"
},
"embedly": {
"key": ""
},
"plugins": [
{ "name": "customise", "url": "static/plugins/customise.html" }
]
}
Re: Trying to get any websocket IRC client to work with UnrealIRCd
Posted: Wed Oct 16, 2024 10:20 am
by CrazyCat
Add
"disconnectOnSaslFail": false, before the embedly block:
Code: Select all
"startupOptions" : {
"server": "redacted.redacted.com",
"port": 8000,
"tls": true,
"direct": true,
"channel": "#kiwiirc-default",
"nick": "kiwi-n?"
},
"disconnectOnSaslFail": false,
"embedly": {
"key": ""
},
I don't think it'll really help but you can test (
https://github.com/kiwiirc/kiwiirc/issu ... -497105109 for explanation of this setting)
If it doesn't work, give me the url of your kiwiirc so I can try to analyse the trouble.
Re: Trying to get any websocket IRC client to work with UnrealIRCd
Posted: Wed Oct 16, 2024 11:20 am
by barryn
After you reply to this I will edit this post and remove the URL.
URL removed.
Re: Trying to get any websocket IRC client to work with UnrealIRCd
Posted: Wed Oct 16, 2024 11:25 am
by barryn
This is the relevant section of unrealircd.conf
Code: Select all
loadmodule "websocket";
loadmodule "webserver";
listen {
ip *;
port 8000;
options {
tls;
websocket { type text; } // type must be either 'text' or 'binary'
};
tls-options {
certificate "/home/irc/unrealircd/conf/tls/server.cert.pem";
key "/home/irc/unrealircd/conf/tls/server.key.pem";
options {
no-client-certificate;
};
};
};
Re: Trying to get any websocket IRC client to work with UnrealIRCd
Posted: Wed Oct 16, 2024 11:30 am
by barryn
I tried a websocket type of binary also, and that did not work either.
Re: Trying to get any websocket IRC client to work with UnrealIRCd
Posted: Wed Oct 16, 2024 11:30 am
by CrazyCat
Well, first you have an error with a call to customise.html which doesn't exists (plugin section of config.json).
And when trying to connect, you have a security error (NS_ERROR_CONTENT_BLOCKED) which should explain why it doesn't work
source of the error: your server returns a canonical name which is not from the same domain, so most of the browsers block that
Re: Trying to get any websocket IRC client to work with UnrealIRCd
Posted: Wed Oct 16, 2024 11:33 am
by barryn
Bookmark it, I am removing the URL now.
Re: Trying to get any websocket IRC client to work with UnrealIRCd
Posted: Wed Oct 16, 2024 10:03 pm
by barryn
I got it working, I needed the unset the header "Content-Security-Policy" on the web server.

It didn't throw any error on the page, it would just never connect to the IRC server.
Re: Trying to get any websocket IRC client to work with UnrealIRCd
Posted: Fri Oct 18, 2024 6:57 am
by Syzop
I made the same mistake when updating the Content-Security-Policy header (CSP) on unrealircd.org a while back.
To fix it I added this to the Content-Security-Polic header string: connect-src wss://irc.unrealircd.org/;
Then
https://www.unrealircd.org/files/dev/ws ... lircd.html was able to connect to irc.unrealircd.org again.
Though by that I broke the ability for it to connect to other sites, and since that websocket demo on unrealircd.org is a test tool I should probably allow all websocket destinations.
By the way, bit off-topic but you can see such errors in Firefox and Chrome in the web developer console. CTRL+SHIFT+I (that's a capital i) and then click the "Console" tab. If you then reload the page or try/click something that doesn't work you will see an error printed there. Just mentioning it so you don't bang your head against the wall too much next time ;D
Re: Trying to get any websocket IRC client to work with UnrealIRCd
Posted: Fri Oct 18, 2024 7:41 am
by barryn
Thanks! I guess we can close this and leave it as a closed issue that others can find. I also created this custom fork of Kiwi IRC with minor changes to the default config.json and updates to the README.md.
Updated Kiwi IRC with notes about using it with Unreal IRC