diff --git a/lib/ipfilter.js b/lib/ipfilter.js
index <HASH>..<HASH> 100644
--- a/lib/ipfilter.js
+++ b/lib/ipfilter.js
@@ -62,6 +62,9 @@ var _ = require('lodash')
 
     if (!ipAddress) {
       ipAddress = req.connection.remoteAddress;
+      if(ipAddress.indexOf(':') !== -1){
+        ipAddress = ipAddress.split(':')[0];
+      }
     }
 
     return ipAddress;
diff --git a/test.js b/test.js
index <HASH>..<HASH> 100644
--- a/test.js
+++ b/test.js
@@ -83,6 +83,13 @@ describe('enforcing IP address whitelist restrictions', function(){
     });
   });
 
+  it('should allow whitelisted port ips',function(done){
+    this.req.connection.remoteAddress = '127.0.0.1:84849';
+    this.ipfilter( this.req, {}, function(){
+      done();
+    });
+  });
+
   it('should deny all non-whitelisted ips', function( done ){
     this.req.connection.remoteAddress = '127.0.0.2';
     var res = {
Adding support for port numbers coming through for ips