Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

The middleware examples with proxy-by-url do not work for my config #86

Closed
digitalrinaldo opened this Issue · 4 comments

2 participants

@digitalrinaldo

Hi,

url-middleware.js
url-middleware2.js

and the example at the proxy-by-url workspace

/private/tmp/http-proxy/1.js:18
});
^

node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
SyntaxError: Unexpected token ;
at Module._compile (module.js:397:25)
at Object..js (module.js:408:10)
at Module.load (module.js:334:31)
at Function._load (module.js:293:12)
at Array. (module.js:421:10)
at EventEmitter._tickCallback (node.js:126:26)

I can't seem to get this example

require('http-proxy').createServer(
require('proxy-by-url')({
'/database': { port: 5984, host: 'localhost' },
})
).listen(8000)

or the url-middleware.js example to work with node I am getting a
unexpected token

m1:node rinaldo$ node url-middleware.js

/opt/node/url-middleware.js:44
});
^

m1:node rinaldo$ npm info proxy-by-url
{ name: 'proxy-by-url',
description: 'custom logic for node-http-proxy to proxy basedon incoming
url',
'dist-tags': { latest: '0.0.0' },
versions: '0.0.0',
maintainers: 'dominictarr dominic.tarr@gmail.com',
time: { '0.0.0': '2011-07-30T09:55:29.217Z' },
author: 'Dominic Tarr dominic.tarr@gmail.com (
http://bit.ly/dominictarr)',
repository:
{ type: 'git',
url: 'git://github.com/dominictarr/proxy-by-url.git' },
version: '0.0.0',
homepage: 'http://github.com/dominictarr/proxy-by-url',
dependencies: {},
devDependencies: {},
scripts: { test: 'meta-test test/.js' },
engines: { node: '
' },
dist:
{ shasum: 'ee8c04d31d20996e7d4a4ce888379890119a73ea',
tarball: '
http://registry.npmjs.org/proxy-by-url/-/proxy-by-url-0.0.0.tgz' },
directories: {} }

Reply to this email directly or view it on GitHub:
http://github.com/inbox/11305033#reply

@dominictarr

uh, this is a syntax error in /private/tmp/http-proxy/1.js

this looks like a missing { or (
or possibly a comment //
on the last line, or an unclosed block comment. /*

it looks like the way you have your enviroment setup is very odd.

have a look in /private/tmp/http-proxy/1.js

also, there was a mistake in proxy-by-url please install the new version. (then your pasted code will work)

@dominictarr

sorry, I just realized that you had already emailed me about this.

please install/pull the new version and also cd examples && npm install

also fixed a small mistake in proxy-by-url, now it's at 0.0.1

this should work now, please confirm.

@digitalrinaldo

Works on my mac with 0.4.9 fails on 4.11-pre on centos

@dominictarr

cool, thanks.

will check this again when 0.4.11 is offically released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.