在代理后面使用 opensubtitles api Node.js/Python 包装器
Using opensubtitles api Node.js/Python wrapper behind a proxy
我正在尝试使用 opensubtitles-api node.js wrapper of opensubtitles api behind a proxy. Unfortunately there is no proxy option available. The library in turn uses node-xmlrpc to make RPC calls. But the underlying node-xmlrpc
library also doesn't support proxy tunneling. My project also benefits from some python
libraries and code. But python 包装器似乎也无法处理代理。我有哪些选择?
因为 node-xmlrpc
使用 http/https 你可以像这样指定一个代理。
const xmlrpc = require('xmlrpc');
const options = {
host: "proxy_url",
port: 8080, // proxy port
path: "http://opensubtitles_url",
headers: {
Host: "opensubtitles_domain",
"Proxy-Authorization": "Basic bXl1c2VyOm15cGFzc3dvcmQ=" // if needed
}
};
const client = xmlrpc.createClient(options);
我正在尝试使用 opensubtitles-api node.js wrapper of opensubtitles api behind a proxy. Unfortunately there is no proxy option available. The library in turn uses node-xmlrpc to make RPC calls. But the underlying node-xmlrpc
library also doesn't support proxy tunneling. My project also benefits from some python
libraries and code. But python 包装器似乎也无法处理代理。我有哪些选择?
因为 node-xmlrpc
使用 http/https 你可以像这样指定一个代理。
const xmlrpc = require('xmlrpc');
const options = {
host: "proxy_url",
port: 8080, // proxy port
path: "http://opensubtitles_url",
headers: {
Host: "opensubtitles_domain",
"Proxy-Authorization": "Basic bXl1c2VyOm15cGFzc3dvcmQ=" // if needed
}
};
const client = xmlrpc.createClient(options);