Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Browser JavaScript app IRC connection

Tags:

javascript

irc

Thanks for any help in advance!

Anyway, I want my JavaScript application to be able to "connect to" or otherwise "communicate with" IRC.

(I need it to run in browser, so no npmjs-dependent solutions, and yes, I have tried Browserify, but a lot of things seem to be un-Browserify-able, so please don't suggest a Browserfiy-related method, unless you're absolutely sure)

It would seem that it is not easy or maybe not possible to "connect" directly to IRC in JavaScript, so I am comfortable with using other, even if more redundant, methods to communicate, including usage of other languages that can be use in-browser, such as Java, or PHP if possible.

I'm open to any suggestions! Thanks so much!

like image 932
Smudge Avatar asked Oct 18 '25 19:10

Smudge


1 Answers

HTML5 introduced stay-alive connections through the WebSocket protocol, which now (HyBi06, WS version 13) is implemented and accepted by almost any device, and very stable. The problem is that IRC does not have a WebSocket communication protocol.

The solution I've built is to create a WebSocket-server that creates a raw connection to the IRC-server for every client and acts as a mediator. Every client runs an IRC-bot I already had developed, which turns messages from the server into events, which means I had to implement all events I wanted to pass on to the Website.

like image 188
Michel Kuipers Chaosje Avatar answered Oct 20 '25 09:10

Michel Kuipers Chaosje



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!