Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to modify requests made to pages that I subscribe to? #24

Open
2gavy opened this issue Apr 29, 2018 · 2 comments
Open

How to modify requests made to pages that I subscribe to? #24

2gavy opened this issue Apr 29, 2018 · 2 comments

Comments

@2gavy
Copy link

2gavy commented Apr 29, 2018

Can i customise the User Agent headers? I want to leverage on socks5-https-client when performing the requests.

Thanks in advance.

@scripting
Copy link
Owner

This seemed like a good idea, so I quickly added a new config.json value that lets you set the User-Agent header.

It's documented here --

https://github.com/scripting/river5/blob/master/docs/CONFIG.md#httpport-1337

Let me know if it works.

@2gavy
Copy link
Author

2gavy commented Apr 30, 2018

Hi,

What should i change the User Agent headers to? It looks like socks5-https-client requires edit to the request headers.

var Agent = require('socks5-http-client/lib/Agent');

request({
	url: 'http://en.wikipedia.org/wiki/SOCKS',
	agentClass: Agent,
	agentOptions: {
		socksHost: 'my-tor-proxy-host', // Defaults to 'localhost'.
		socksPort: 9050 // Defaults to 1080.
	}
}, function(err, res) {
	console.log(err || res.body);
});

I think i'll have to npm install socks5 first, then pass the Agent into the request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants