Skip to content

Commit 91aba1b

Browse files
committed
Listen on IP option
1 parent 4792b78 commit 91aba1b

File tree

5 files changed

+15
-1
lines changed

5 files changed

+15
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ webircPassword: if its there, it will try webirc authentication
4747
webircHashIp: true or false if you want to just hide their ip but provide a hash
4848
webircProxy: true or false if you want to pass their real ip (only matters with stunnel)
4949
ingresswebircPassword: a password for webirc clients to use when connecting to jbnc
50+
bouncerIp: ip you want to bind to or leave null
5051
bouncerPort: port for bnc (do "+6697" if you want SSL (wrap in "" and put +)),
5152
bouncerAdmin: admin pass
5253
bouncerShack: ping ack timeout

bouncer.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ else process.exit(1);
1616

1717
// Set config vars
1818
var BOUNCER_PORT = config.bouncerPort?config.bouncerPort:8888;
19+
const BOUNCER_IP = config.bouncerIp?config.bouncerIp:null;
1920
const BOUNCER_USER = config.bouncerUser?config.bouncerUser:'';
2021
var BOUNCER_PASSWORD = config.bouncerPassword?config.bouncerPassword:'';
2122
var BOUNCER_ADMIN = config.bouncerAdmin?config.bouncerAdmin:'';
@@ -673,6 +674,8 @@ function clientConnect(socket) {
673674
_success=false;
674675
}
675676
if(_success) {
677+
if(DEBUG)
678+
console.log("Starting connect");
676679
// bouncer connections
677680
connection.parents = [];
678681
connection.parents[0] = socket;
@@ -709,6 +712,8 @@ function clientConnect(socket) {
709712

710713
connection.on('connect',async function() {
711714
this.write("CAP LS 302\n");
715+
if(DEBUG)
716+
console.log("CAP LS 302");
712717
if(SERVER_WEBIRC.length>0) {
713718
if(this.host==":1")
714719
this.host="127.0.0.1";
@@ -732,6 +737,8 @@ function clientConnect(socket) {
732737
this.write('NICK '+this.nick+'\n');
733738
this.write('USER '+this.user+' * 0 :'+this.realname+'\n');
734739
connections[hash(this.nick_original+this.user+this.password+this.server+this.port.toString())] = this;
740+
if(DEBUG)
741+
console.log("Connection created.");
735742
});
736743
connection.on('data', function(d){
737744
if(d.toString().substr(d.length-1)!="\n")
@@ -1150,5 +1157,8 @@ function clientConnect(socket) {
11501157
socket.end();
11511158
}
11521159
}
1160+
if(BOUNCER_IP)
1161+
server.listen(BOUNCER_PORT, BOUNCER_IP);
1162+
else
1163+
server.listen(BOUNCER_PORT);
11531164

1154-
server.listen(BOUNCER_PORT);

examples/example-gateway.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"bouncerUser":"",
44
"bouncerPassword":"",
55
"bouncerShack":10,
6+
"bouncerIp":null,
67

78
"serverPort":"6667",
89
"server":"127.0.0.1",

examples/example-singleuser.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"bouncerUser":"johnsmith",
44
"bouncerPassword":"JFiwefani32",
55
"bouncerShack":10,
6+
"bouncerIp":null,
67

78
"serverPort":"",
89
"server":"",

examples/example.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"bouncerUser":"",
44
"bouncerPassword":"",
55
"bouncerShack":10,
6+
"bouncerIp":null,
67

78
"serverPort":"",
89
"server":"",

0 commit comments

Comments
 (0)