Skip to content

Reconnecting to an existing IRC session with irc-framework #395

@Madriix

Description

@Madriix

Hello, I’m trying to build a browser-based IRC client using Socket.IO on the Node.js side, and I’m trying to do something like this:

if (session && session.ircState === 'idle') {
  session.irc = new IRC.Client();
  session.ircState = 'connecting';

  this.bindings(client, session.irc, debug, session);

  session.irc.connect(baseConfig);
} else if (
  session &&
  ['connecting', 'connected', 'disconnected'].includes(session.ircState)
) {
  this.bindings(client, session.irc, debug, session);
}

The first if corresponds to the client’s first connection, and when it reconnects, it goes into the else block.

Is there a command similar to connect() that would allow me to “reconnect”, but without closing the previous connection and while resuming everything normally?

You should know that the client is actually still connected to IRC, like a kind of persistent BNC using irc-framework, and each web client connects with its own new IRC.Client(). However, I’m having trouble retrieving an existing irc-framework session.

I’ve been spending days on this without success, and this is the last missing piece. Once this is solved, the client + Socket.IO + irc-framework stack will be about 99% operational.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions