Skip to content

Commit 8a419c9

Browse files
authored
Merge pull request #46 from Madriix/master
Addition of the account in the command for PASS (optional)
2 parents f24ae45 + e59b054 commit 8a419c9

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ Here is an example for a desktop connecting to an irc server that is password pr
9696
dragon||AJFiej2fn2345/irc.dal.net:6667||somepassword/desktop
9797
```
9898

99+
Optional: you can put the account at the end for SASL identification, ideal if the account is not the nick used:
100+
```
101+
dragon||AJFiej2fn2345/irc.dal.net:6667/mobile/ArMyN
102+
```
103+
99104
#### SSL Client
100105
Use "+port" to do SSL. For example:
101106
```

bouncer.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ server = doServer(tlsOptions,function(socket) {
191191
this.irc.realname=null;
192192
this.irc.serverpassword=null;
193193
this.irc.nickpassword=null;
194+
this.irc.accountsasl=null;
194195
origin = commands[1].trim().split("/");
195196
if(origin[0].indexOf("||")>0)
196197
this.irc.password = origin[0].split("||")[1];
@@ -213,7 +214,7 @@ server = doServer(tlsOptions,function(socket) {
213214
}
214215
}
215216
else {
216-
if(origin.length!=2 && origin.length!=3)
217+
if(origin.length!=2 && origin.length!=3 && origin.length!=4)
217218
this.end();
218219
else {
219220
_server_pass = origin[1].split("||");
@@ -228,6 +229,8 @@ server = doServer(tlsOptions,function(socket) {
228229
}
229230
if(origin[2])
230231
this.clientbuffer=origin[2].trim();
232+
if(origin[3])
233+
this.irc.accountsasl=origin[3].trim();
231234
}
232235
}
233236
}
@@ -747,7 +750,8 @@ function clientConnect(socket) {
747750
connection.nick = socket.irc.nick;
748751
connection.nick_original = socket.irc.nick;
749752
connection.password = socket.irc.password;
750-
connection.nickpassword = socket.irc.nickpassword;
753+
connection.nickpassword = socket.irc.nickpassword;
754+
connection.accountsasl = socket.irc.accountsasl;
751755
connection.user = socket.irc.user;
752756
connection.ircuser = socket.irc.user;
753757
connection.server = socket.irc.server;
@@ -854,8 +858,8 @@ function clientConnect(socket) {
854858
}
855859

856860
if(this.sasl && data[0]=="AUTHENTICATE" && data[1]=="+") {
857-
const auth_str = this.nick + '\0' +
858-
this.nick + '\0' +
861+
const auth_str = (this.accountsasl ? this.accountsasl : this.nick) + '\0' +
862+
(this.accountsasl ? this.accountsasl : this.nick) + '\0' +
859863
this.nickpassword;
860864

861865
const b = Buffer.from(auth_str, 'utf8');

0 commit comments

Comments
 (0)