Comments (5)
I think that
data.remoteRequest.on('error', next);
Should be
data.remoteResponse.on('error', next);
from node-unblocker.
Hi Cliff, sorry for the delay in responding. Proxy support isn't not something that I think I could implement any time soon. But if you want to put in the work, I'd be interested to see what you come up with and would consider merging it in.
from node-unblocker.
If anyone wants to implement request/request
module these are the things I did:
- Install the module
- Require it in
lib/proxy.js
- Add
uri: uri
to the options variable - Replace
data.remoteRequest = proto....
with
data.remoteRequest = request(options)
data.remoteRequest.on('response', function(remoteResponse) {
data.remoteResponse = remoteResponse;
data.remoteRequest.on('error', next);
proxyResponse(data)
})
Seems to be working with minimal changes to the file. This gives you the option to add a proxy
value to the options variable. Should be safe to remove the proto variable as well.
Gist: https://gist.github.com/pepzwee/7dabaec9c3273a94f099e44a4e49e224
from node-unblocker.
Ah, my bad. 😰 Yeah, it should be remoteResponse
instead.
from node-unblocker.
Cool. I like keeping the core of the library fairly low-level, but if you want to send a PR to make that part configurable, and then maybe an example that shows how to use request
there, I'd be happy to merge that in.
It could be something like a makeRequest
configuration option that can be set to a function - have it accept the data object and a callback. It should make the request, update data
, then call the callback. Once the callback is fired, then call proxyResponse(data)
.
And then if makeRequest
isn't set, it can default to something pretty similar to the existing code, only with proxyResponse(data)
replaced with the callback.
from node-unblocker.
Related Issues (20)
- [Bug] Does Not work. HOT 10
- Weird Redirect when deploying with openode.io HOT 2
- Error HOT 1
- Discord isn't working. HOT 5
- Discord link HOT 2
- Next.js support HOT 3
- maleik2
- JustAguy HOT 1
- In Search Of A Proxy HOT 2
- Setting a static URL without typing it after the prefix HOT 7
- Google safe-browsing flags unblocker as phishing
- Proxy not working with Nike.com and Cloudflare HOT 2
- My administrator's website still blocks it even when I use unblockernode
- Z_DATA_ERROR HOT 7
- use node-unblocker in client sveltekit without node js HOT 1
- how to use node-unblocker with https-proxy-agent HOT 1
- sometime error and stuck when use in docker HOT 3
- https://www.youtube.com/embed/XGxIE1hr0w4 --This type of URL cannot be proxied HOT 8
- URL PATH - [feature] HOT 6
- how to add ads in unblocked website HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-unblocker.