Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • N node-http-proxy
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 482
    • Issues 482
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 102
    • Merge requests 102
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • http ... PARTY!
  • node-http-proxy
  • Issues
  • #553
Closed
Open
Issue created Jan 17, 2014 by Administrator@rootContributor

Using .createProxy() Errors When Used

Created by: Albert-IV

From your examples on the Nodejitsu blog, the following code should redirect correctly:

var http      = require('http'),
    httpProxy = require('http-proxy');

var proxy = httpProxy.createProxy();


http.createServer(function(req, res) {
  res.end('hi!');
}).listen(3000);


require('http').createServer(function(req, res) {
  proxy.web(req, res, { target: 'http://127.0.0.1:3000' });
}).listen(8000);

When you hit http://localhost:8000, the proxy process dies with this error:

TypeError: Cannot read property 'length' of undefined

Node v0.10.24, http-proxy v1.0.0

Assignee
Assign to
Time tracking