can't include http proxy library
See original GitHub issueI 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:
- Created 8 years ago
- Comments:10 (7 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hmm, it looks like the issue is caused within the
http-proxy/lib/http-proxy.jsfile; ifhttpProxy = require('./http-proxy/')is changed tohttpProxy = require('./http-proxy/index.js')it seems to work correctly? :-sClosing! Comment if there are still issues regarding this