diff --git a/lib/http-console.js b/lib/http-console.js index 73cfb78..4b82a9d 100644 --- a/lib/http-console.js +++ b/lib/http-console.js @@ -177,6 +177,17 @@ this.Console.prototype = new(function () { this.exec(command.replace(/^\\/, '.')); } else if (match = command.match(/^([a-zA-Z-]+):\s*(.*)/)) { if (match[2]) { + if (match[1].toLowerCase() === 'host') { + if (match[2].indexOf(':') !== -1) { + parts = match[2].split(':'); + this.host = parts[0]; + this.port = parseInt(parts[1]) || 80; + match[2] = this.host; + } else { + this.host = match[2]; + this.port = 80; + } + } this.headers[match[1]] = match[2]; } else { delete(this.headers[match[1]]);