Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add support for secure (SSL) & passworded servers #110

Merged
merged 1 commit into from

2 participants

@cwc

This is pretty basic at the moment. I just added what I needed in order to connect to our office's server. Probably needs more error-handling, UI tweaks, etc.

Suggestions welcome.

@thedjpetersen thedjpetersen merged commit db22e75 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 21, 2012
  1. @cwc
This page is out of date. Refresh to see the latest.
View
10 assets/js/views/overview.js
@@ -47,6 +47,10 @@ var OverviewView = Backbone.View.extend({
$('.error').removeClass('error');
var server = $('#connect-server').val();
var nick = $('#connect-nick').val();
+ var port = $('#connect-port').val();
+ var secure = $('#connect-secure').val();
+ var selfSigned = $('#connect-selfSigned').val();
+ var password = $('#connect-password').val();
if (!server) {
$('#connect-server').closest('.clearfix').addClass('error');
$('#connect-server').addClass('error');
@@ -61,7 +65,11 @@ var OverviewView = Backbone.View.extend({
var connectInfo = {
nick: nick,
- server: server
+ server: server,
+ port: port,
+ secure: secure,
+ selfSigned: selfSigned,
+ password: password
};
irc.me = new User(connectInfo);
irc.me.on('change:nick', irc.appView.renderUserBox);
View
4 lib/irchandler.js
@@ -123,6 +123,10 @@ var irchandler = exports.irchandler = function(socket) {
}
if(client === undefined) {
client = new irc.Client(data.server, data.nick, {
+ port: data.port || 6667,
+ password: data.password,
+ secure: data.secure,
+ selfSigned: data.selfSigned,
debug: true,
logged_in: false,
showErrors: true,
View
16 views/templates.jade
@@ -42,6 +42,22 @@ script(id="overview_connection", type="text/html")
label(for="connect-nick") Nick
.controls
input#connect-nick(type="text")
+ .control-group
+ label(for="connect-port") Port
+ .controls
+ input#connect-port(type="text")
+ .control-group
+ label(for="connect-secure") SSL
+ .controls
+ input#connect-secure(type="checkbox")
+ .control-group
+ label(for="connect-selfSigned") Self-signed SSL Cert
+ .controls
+ input#connect-selfSigned(type="checkbox")
+ .control-group
+ label(for="connect-password") Password
+ .controls
+ input#connect-password(type="password")
a(id="connect-button", class="btn btn-primary", type="button") Connect
script(id="overview_settings", type="text/html")
Something went wrong with that request. Please try again.