// State machine representing URI's
//
// Cleans up the logic of connecting via ports,
// urls or file sockets.

var state = require('state');

module.exports = state({
  // Possible states for the URI
  Initial: state('initial', {
    set: function(value) {
      this.input = value;
    }
  }),
  Url: state(),
  Port: state(),
  File: state(),

  // default for all
  get: function() {
    return this.input;
  }
});

@@ -135,16 +135,74 @@
 state');
+%0Avar isUrl = require('is-url');%0Avar _ = require('lodash');
 %0A%0Amodule
@@ -301,21 +301,21 @@
 unction(
-value
+input
 ) %7B%0A    
@@ -333,13 +333,191 @@
 t = 
-value
+input;%0A    %7D,%0A    listen: function(input) %7B%0A      this.mode = 'listen';%0A      this.set(input);%0A    %7D,%0A    forward: function(input) %7B%0A      this.mode = 'forward';%0A      this.set(input)
 ;%0A  
@@ -641,16 +641,105 @@
 .input;%0A
-
   %7D
+,%0A%0A  // noops in all but initial state.%0A  listen: function() %7B%7D,%0A  forward: function() %7B%7D
 %0A%7D);%0A

Add listen and forward methods.