var net = require('net');

var Peer = function (host, port) {
  this.host = host;
  this.port = port ? +port : 8333;
};

Peer.prototype.createConnection = function () {
  var c = net.createConnection(this.port, this.host);
  return c;
};

Peer.prototype.toString = function () {
  return this.host + ":" + this.port;
};

exports.Peer = Peer;

@@ -55,16 +55,177 @@
 port) %7B%0A
+  if (%22string%22 === typeof host) %7B%0A    if (host.indexOf(':') && !port) %7B%0A      var parts = host.split(':');%0A      host = parts%5B0%5D;%0A      port = parts%5B1%5D;%0A    %7D%0A  
   this.h
@@ -236,16 +236,18 @@
 = host;%0A
+  
   this.p
@@ -273,16 +273,225 @@
 : 8333;%0A
+  %7D else if (host instanceof Peer) %7B%0A    this.host = host.host;%0A    this.port = host.port;%0A  %7D else %7B%0A    logger.warn('Could not instantiate peer, invalid parameter type: ' +%0A                typeof host);%0A  %7D%0A
 %7D;%0A%0APeer

Handle string format when instantiating peers.