this.httpHandler = function (request, response) {
var uri, uri_parts, subs, useragent, agent, server_set, server, nick, debug, touchscreen, hash,
- min = {}, public_http_path,
+ min = {}, public_http_path, port, ssl,
secure = (typeof request.client.encrypted === 'object');
- try {
+ //try {
if (kiwi.config.handle_http) {
uri = url.parse(request.url, true);
uri_parts = uri.pathname.split('/');
server_set = ((typeof uri.query.server !== 'undefined') && (uri.query.server !== ''));
server = uri.query.server || 'irc.anonnet.org';
nick = uri.query.nick || '';
+ port = 6667;
+ ssl = false;
} else {
server_set = false;
server = 'irc.anonnet.org';
nick = '';
+ port = 6667;
+ ssl = false;
}
} else {
server_set = ((typeof uri_parts[2] !== 'undefined') && (uri_parts[2] !== ''));
server = server_set ? uri_parts[2] : 'irc.anonnet.org';
+ if (server.search(/:/) > 0) {
+ port = server.substring(server.search(/:/) + 1);
+ server = server.substring(0, server.search(/:/));
+ if (port[0] == '+') {
+ port = port.substring(1);
+ ssl = true;
+ }
+ }
nick = uri.query.nick || '';
}
.update(server_set ? 't' : 'f')
.update(secure ? 't' : 'f')
.update(server)
+ .update(port)
+ .update(ssl ? 't' : 'f')
.update(nick)
.update(agent)
.update(JSON.stringify(kiwi.config))
var html, hash2;
if (!err) {
try {
- html = kiwi.jade.compile(str)({ "touchscreen": touchscreen, "debug": debug, "secure": secure, "server_set": server_set, "server": server, "nick": nick, "agent": agent, "config": kiwi.config });
+ html = kiwi.jade.compile(str)({ "touchscreen": touchscreen, "debug": debug, "secure": secure, "server_set": server_set, "server": server, "port": port, "ssl": ssl, "nick": nick, "agent": agent, "config": kiwi.config });
hash2 = crypto.createHash('md5').update(html).digest('base64');
kiwi.cache.html[hash] = {"html": html, "hash": hash2};
if (request.headers['if-none-match'] === hash2) {
}
}
- } catch (e) {
- console.log('ERROR app.httpHandler()');
- console.log(e);
- }
+ //} catch (e) {
+ // console.log('ERROR app.httpHandler()');
+ // console.log(e);
+ //}
};
input(type="text", id="channel", name="channel", class="channel", value="#kiwiirc")
li(class="section")
label(for="port") Port:
- input(type="text", id="port", name="port", class="port", value="6667")
+ input(type="text", id="port", name="port", class="port", value=port)
li
label(for="ssl") SSL:
- input(type="checkbox", id="ssl", name="ssl", class="ssl")
+ - if (ssl)
+ input(type="checkbox", id="ssl", name="ssl", class="ssl", checked)
+ - else
+ input(type="checkbox", id="ssl", name="ssl", class="ssl")
+
a.connect(href="") Connect...