Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 12 additions and 4 deletions.
  1. +11 −3 lib/irc.js
  2. +1 −1  package.json
View
14 lib/irc.js
@@ -10,6 +10,7 @@
var net = require( 'net' )
, path = require( 'path' )
, fs = require( 'fs' )
+ , tls = require( 'tls' )
, ColouredLog = require( 'coloured-log' )
, Log
, Compiler
@@ -162,7 +163,13 @@ function IRC( options ) {
stream = null
}
- stream = new net.Stream()
+ if ( this.options.ssl )
+ stream = new tls.connect(this.options.port, this.options.server )
+ else {
+ stream = new net.Stream()
+ stream.connect(this.options.port, this.options.server)
+ }
+
stream.setEncoding( this.options.encoding )
stream.setTimeout( 0 )
@@ -180,8 +187,6 @@ function IRC( options ) {
// End
stream.addListener( 'end', do_disconnect.bind( this ) )
-
- stream.connect(this.options.port, this.options.server)
}
// Holla
@@ -219,6 +224,8 @@ function IRC( options ) {
if ( !/\r\n$/.test( data ) )
data += "\r\n"
stream.write( data )
+ if ( /PRIVMSG/.test( data ) )
+ parseMessage.call(this, ':' + this.options.nick + '!' + this.options.user.username + '@' + this.options.user.hostname + ' ' + data )
if ( this.options.log )
Log.info( "[SENT] " + data.replace( /\r\n$/, "" ) )
}
@@ -700,6 +707,7 @@ IRC.options =
, encoding: 'ascii'
, nick: 'js-irc'
, log: true
+ , ssl: false
, user:
{ username: 'js-irc'
, hostname: 'thetubes'
View
2  package.json
@@ -11,7 +11,7 @@
, "version" : "0.2.15"
, "main" : "./lib/irc"
, "directories" : { "lib" : "./lib", "node_libraries" : "./node_libraries" }
-, "engines" : [ "node >=0.2.0" ]
+, "engines" : [ "node >=0.4.0" ]
, "dependencies" :
{ "coloured-log" : ">= 0.9.4"
}

No commit comments for this range

Something went wrong with that request. Please try again.