Open jaunusa opened 1 year ago
I did more tests to try to pass through a proxy with authentication using deepl-node package (version 1.10.2), without success. Always getting a Bad request
with this proxy configuration:
host: 'proxy.myproxy.com',
port: 4567,
protocol: 'http',
auth: {
username: myuser,
password: mypw
}
I used a lot of packages with included axios and couldn't pass the proxy. The only working fix was to use my own axios instances, configured with the axios config from my first post. https://github.com/DeepLcom/deepl-node/issues/37#issue-1937775210
Simple cURL tests with proxy params work too, so it has to be some special axios implementation for this two types of config.
Is there a way to inject the working kind of config to the deepl-node axios instance? Or is there an easy way to make this package take additional parameters for httpAgent and proxy (as bool)?
The options parameter of the Translator constructor only takes one type of proxy as
ProxyConfig
(looks same asAxiosProxyConfig
). 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: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 :(