Skip to content

Axios proxy as URL #37

Open
Open
@jaunusa

Description

@jaunusa

The options parameter of the Translator constructor only takes one type of proxy as ProxyConfig (looks same as AxiosProxyConfig).
It would be useful to be able to use a proxy URL string as proxy parameter. An axios instance creation in the client should look like this:

import { HttpProxyAgent, HttpProxyAgent } from 'hpagent';
axios.create({
   proxy: true,
   httpsAgent: new HttpsProxyAgent({ proxy: 'http://user:[email protected]:4567' })
   httpAgent: new HttpProxyAgent({ proxy: 'http://user:[email protected]:4567' })
})

Would it be an improvement in flexibility?
I always use one secret for the whole proxy URL, so it would help a lot.

The most flexible approach would be to have an axiosInstanace parameter for the Translator constructor, but this would cause a lot of code rewrites :(

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions