标签: proxy

如何使用 Vercel 设置代理

我的 API 它在另一个域下运行..并且我正在尝试使用 Vercel 配置代理..

它正在向应用程序发出请求,/api/test.json所以我尝试...在 vercel 配置上

"redirects": [
        {
            "source": "/api/test.json",
            "destination": "https://myapi.com/test.json",
        }
    ],
    "rewrites": [
        {
            "source": "/(.*)",
            "destination": "/index.html"
        }
    ]
Run Code Online (Sandbox Code Playgroud)

我收到了 404/api/test.json

proxy vercel

6
推荐指数
2
解决办法
8567
查看次数

How to set up terraform behind proxy?

I am trying to run terraform behind a proxy on Windows. I have already set my proxy on CMD by doing: set HTTP_PROXY and set HTTPS_PROXY.

Here is the error I am getting:

Initializing provider plugins...
- Finding latest version of hashicorp/aws...

Error: Failed to query available provider packages

Could not retrieve the list of available versions for provider hashicorp/aws:
could not connect to registry.terraform.io: Failed to request discovery
document: Get "https://registry.terraform.io/.well-known/terraform.json":
proxyconnect tcp: tls: first record does not look …
Run Code Online (Sandbox Code Playgroud)

proxy terraform

6
推荐指数
1
解决办法
2万
查看次数

如何在 Selenium 4.x 中将 Selenium 与 Firefox 代理结合使用

我需要传递选项,因为配置文件已被弃用。我正在尝试使用 FF 代理到安全浏览器。但是,我遇到了一个问题,如下所述:

我的代码:

from selenium import webdriver
from selenium.webdriver.common.by import By
from webdriver_manager.firefox import GeckoDriverManager
from selenium.webdriver.firefox.service import Service
from selenium.webdriver.firefox.options import Options as FirefoxOptions
from selenium.webdriver.common.proxy import Proxy, ProxyType

socks = '127.0.0.1:9050'
profile_path = '~/Library/Application\ Support/TorBrowser-Data/Browser/tjv18qgq.default'
capabilities = webdriver.DesiredCapabilities.FIREFOX
proxy = Proxy({
    "proxyType": 'manual',
    "httpProxy": socks,
    "sslProxy": socks,
    "noProxy": ''
})
proxy.add_to_capabilities(capabilities)
options = FirefoxOptions()
options.headless = False
options.set_preference('profile', profile_path)
options.set_capability("proxy", proxy)
service = Service(executable_path=GeckoDriverManager().install())
driver = webdriver.Firefox(service=service, options=options)

driver.get('https://check.torproject.org/')
element = driver.find_element(By.TAG_NAME, 'h1')
if element.text == 'Sorry. …
Run Code Online (Sandbox Code Playgroud)

python firefox proxy selenium geckodriver

6
推荐指数
1
解决办法
8913
查看次数

未检测到的 chromedriver 如何使用用户名/密码添加代理?

我以这种方式添加 chrome 选项,如果我使用代理 ip 身份验证,它就可以工作。

    options = webdriver.ChromeOptions() 
    options.headless = True
    options.add_argument('--proxy-server=92.128.165.143:3399')
    driver = uc.Chrome(options=options)
Run Code Online (Sandbox Code Playgroud)

但是,我有一个具有以下格式身份验证的代理: http://username:password@91.92.128.165.143:3399

如果我添加它就像

options.add_argument('--proxy-server=http://username:password@91.92.128.165.143:3399')
Run Code Online (Sandbox Code Playgroud)

它不起作用。我如何使用用户名/密码添加它?这仅适用于未检测到的 Chrome 驱动程序。

proxy selenium selenium-chromedriver undetected-chromedriver

6
推荐指数
1
解决办法
6322
查看次数

在企业代理中尝试 SSH 时连接被未知端口 65535 关闭

我一直在尝试设置一个 SSH 跳转服务器,以便在工作时连接到我的服务器,它使用了一个非常烦人(且缓慢)的公司代理,并阻止除端口 443 和 80 之外的所有外部连接。

我已经设置了一个测试服务器,如果可行的话,我将使用它作为跳转服务器,以接受端口 443 上的 SSH 连接。

这就是我尝试连接的方式

ssh -vvv ubuntu@jump-ssh-server -p 443 -o ProxyCommand="ncat --proxy proxy_server:3128 --proxy-auth proxy_user:proxy_password -C %h %p"
Run Code Online (Sandbox Code Playgroud)

如果我尝试仅ProxyCommand在终端中运行它就可以了。但是,当我尝试使用 ssh 连接运行它时,出现错误

OpenSSH_8.6p1, LibreSSL 3.3.5
debug1: Reading configuration data /Users/user/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files
debug1: /etc/ssh/ssh_config line 54: Applying options for *
debug2: resolve_canonicalize: hostname jump_server is address
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/Users/user/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/Users/user/.ssh/known_hosts2' …
Run Code Online (Sandbox Code Playgroud)

ssh proxy

6
推荐指数
1
解决办法
2万
查看次数

Burp 代理拦截不适用于使用 Firefox 的本地 Web 应用程序

虽然我可以并且确实将Burp代理Firefox用于远程 Web 服务器,没有任何问题,但我似乎无法让它在本地网络上与我在本地服务器上托管的测试 Web 应用程序一起工作。

Burp无法看到来自这些请求的流量。我缺少什么?这里相关问题中建议的一些解决方案根本没有帮助我。

firefox proxy interception burp

6
推荐指数
1
解决办法
926
查看次数

如何使 yfinance 通过 HTTP(S) 或ocks5 代理工作?

Yahoo网站可以通过浏览器中的2081端口打开(在Firefox中为HTTP和HTTPS设置代理端口2081)。端口 2081 提供 HTTP(S) 代理。

2080端口提供SOCKS5代理服务:

url="https://query1.finance.yahoo.com/v7/finance/download/MSFT"
curl --socks5-hostname 127.0.0.1:2080 $url -o msft.txt
Run Code Online (Sandbox Code Playgroud)

我现在可以下载 Yahoo 数据,并希望通过此代理使用yfinance库。

尝试方法1:

import yfinance as yf
msft = yf.Ticker("MSFT")
msft.history(proxy="http://127.0.0.1:2081")
msft.history(proxy="https://127.0.0.1:2081")
msft.history(proxy="socks5://127.0.0.1:2080")
Run Code Online (Sandbox Code Playgroud)

它们都不起作用!它们具有相同的输出:

MSFT: No price data found, symbol may be delisted (period=1mo)
Empty DataFrame
Columns: [Open, High, Low, Close, Adj Close, Volume]
Index: []
Run Code Online (Sandbox Code Playgroud)

尝试方法2:

MSFT: No price data found, symbol may be delisted (period=1mo)
Empty DataFrame
Columns: [Open, High, Low, Close, Adj Close, Volume]
Index: []
Run Code Online (Sandbox Code Playgroud)

输出:

cd ~
export …
Run Code Online (Sandbox Code Playgroud)

proxy python-3.x yfinance

6
推荐指数
1
解决办法
492
查看次数

使用 Selenium Chrome 代理 SOCKS 5 身份验证

我有 SOCKS 5 代理的凭据(主机、端口、用户名、密码)。我想设置该代理并与 selenium-Chrome 一起使用。

from selenium import webdriver
from selenium.webdriver.common.proxy import Proxy, ProxyType

proxy = Proxy()
proxy.socksProxy = '123.12.12.12:80'
proxy.socksUsername = 'my_username'
proxy.socksPassword = 'my_password'

capabilities = webdriver.DesiredCapabilities.CHROME
proxy.add_to_capabilities(capabilities)

driver = webdriver.Chrome(desired_capabilities=capabilities)
driver.get("https://wtfismyip.com/")
Run Code Online (Sandbox Code Playgroud)

但是IP不会改变。我已经知道如何设置不需要身份验证的代理(只需使用 chromedirver 选项 --proxy-server),但此方法不接受用户名和密码。

知道为什么此代码不起作用吗?

python authentication proxy socks selenium-chromedriver

5
推荐指数
1
解决办法
1874
查看次数

设置应用级代理

我正在尝试创建某种 SDK,无论它使用的是哪个 HTTP 客户端(无论是原生 HttpURLConnection、OkHttp、Retrofit 等),我们都会拦截来自我的应用程序的每个请求。并包括来自第三方库(如 Firebase Analytics 等)的流量。

我需要拦截并检查几个参数,然后决定是允许还是阻止当前请求。

我不想使用任何自定义 VPN,因为它有一些副作用,例如显示系统级通知和来自用户设备的所有流量。

是否可以通过设置app level代理来捕获所有请求?如果可能,如何在代码中实现它?

sdk proxy android

5
推荐指数
1
解决办法
1662
查看次数

节点 - express-http-proxy - 在代理之前设置标头

在我代理到一个地址之前,我想设置代理的标头(就像拦截器一样)。我使用 express-http-library 并用 Node.JS 表达。到目前为止,我的代码如下所示。顺便提一句。这个图书馆的文档并没有让我变得更聪明。

app.use('/v1/*', proxy('velodrome.usefixie.com', {
userResHeaderDecorator(headers, userReq, userRes, proxyReq, proxyRes) {
    // recieves an Object of headers, returns an Object of headers.
    headers = {
        Host: 'api.clashofclans.com',
        'Proxy-Authorization': `Basic ${new Buffer('token').toString('base64')}`
    };
    console.log(headers);

    return headers;
}
Run Code Online (Sandbox Code Playgroud)

}));

即使控制台将标题 obj 打印出来。正如预期的那样,代理授权不起作用:

{ Host: 'api.clashofclans.com',
  'Proxy-Authorization': 'Basic token' }
Run Code Online (Sandbox Code Playgroud)

谁能帮我吗?

proxy http node.js express

5
推荐指数
2
解决办法
4319
查看次数