question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

can't include http proxy library

See original GitHub issue

I include this library https://github.com/nodejitsu/node-http-proxy to my project. I can run nexe to create my single file successfully, but when I ran the binary file. It gives the following error at the bottom.

I then exclude the module by using the dynamic require technique mentioned in this page https://github.com/jaredallard/nexe, and put it alongside with the single file, it works then.

I’m pretty sure the issue comes from the one line: var httpProxy = require('http-proxy'); in my app.js.

New to node.js. Is it because this is an “native module” so I can’t include it? It doesn’t look like one.

nexe.js:25123
module.exports.createProxy = function createProxyServer(options) {
^
TypeError: Cannot set property 'createProxy' of undefined
at Array.call./home/selu/linguo-ui-lite/node_modules/http-proxy/lib/http-proxy.js.http (nexe.js:25123:30)
at initModule (nexe.js:29:11)
at nexe.js:31:64
at Array.call./home/selu/linguo-ui-lite/node_modules/http-proxy/index.js../lib/http-proxy (nexe.js:25095:18)
at initModule (nexe.js:29:11)
at nexe.js:31:64
at Array.call./home/selu/linguo-ui-lite/app.js.http (nexe.js:52:17)
at initModule (nexe.js:29:11)
at Array.forEach (native)
at nexe.js:39:8

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
bruce-onecommented, Sep 9, 2016

Hmm, it looks like the issue is caused within the http-proxy/lib/http-proxy.js file; if httpProxy = require('./http-proxy/') is changed to httpProxy = require('./http-proxy/index.js') it seems to work correctly? :-s

1reaction
calebboydcommented, Aug 5, 2017

Closing! Comment if there are still issues regarding this

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting Git to work with a proxy server - Stack Overflow
Command to use: git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:8080. change proxyuser to your proxy user; change proxypwd to your ...
Read more >
Can't consume web services via an HTTP proxy server - .NET ...
Cause. An HTTP proxy server exists between the Web service and the .NET client, and the proper proxy settings have not been configured....
Read more >
Unable to deploy behind a proxy · Issue #155 · firebase ...
I have this behavior while being behind a proxy (http_proxy and https_proxy are set in the env). Is there a way to deploy...
Read more >
http-proxy - npm
node-http-proxy is an HTTP programmable proxying library that supports websockets. It is suitable for implementing components such as ...
Read more >
How to Use Pip with a Proxy Server - ActiveState
Click to install and use PIP with a Proxy server for security and privacy. Understand the alternative way to secure pip use.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found