Skip to content

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

Open

Description

@2gavy

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

Thanks in advance.

Activity

  1. scripting commented on Apr 29, 2018

    @scripting
    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.

  2. 2gavy commented on Apr 30, 2018

    @2gavy
    Author

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions