我正在尝试通过无服务器 Lambda 代理外部 API。尝试以下代码示例:http://localhost:3000/users/1返回 200 但正文为空。我必须忽略一些东西,因为http://localhost:3000/users/11返回 404 (如预期)。
索引.js
'use strict';
const serverless = require('serverless-http');
const express = require('express');
const {
createProxyMiddleware
} = require('http-proxy-middleware');
const app = express();
const jsonPlaceholderProxy = createProxyMiddleware({
target: 'http://jsonplaceholder.typicode.com',
changeOrigin: true,
logLevel: 'debug'
});
app.use('/users', jsonPlaceholderProxy);
app.get('/', (req, res) => {
res.json({
msg: 'Hello from Serverless!'
})
})
const handler = serverless(app);
module.exports.handler = async (event, context) => {
try {
const result = await handler(event, context);
return result;
} …Run Code Online (Sandbox Code Playgroud) 我在本地端口 8500 上设置了一个模拟服务器进行测试,其行为就像代理一样。我读到 Chrome 将忽略来自本地主机的请求的代理设置,并且需要添加--proxy-bypass-list=<-loopback>以禁用/绕过该规则。它一直工作到今天。
我的配置: 系统:MacOs Catalina,10.15.3 浏览器:Chrome 版本 80.0.3987.149
启动 chrome 的参数是--ignore-certificate-errors,--proxy-bypass-list="<-loopback>",--proxy-server=http://localhost:8500
我使用 selenium 进行自动化,基本 url 是http://localhost:8080
运行后,我可以看到“外部”url 调用,例如 cdn js 文件,字体文件实际上正在通过端口 8500 上的代理服务器。但我找不到任何 localhost 调用然后我将 baseUrl 更改为我的测试环境之一例如,不是本地主机10.10.10.10:8080,我可以看到所有流量都通过代理,包括到的流量10.10.10.10:8080
我怀疑新的 chrome 版本是否违反了绕过规则,因为我今天早些时候进行了更新。
请帮忙!谢谢你!
我们的自动化脚本连接到第三方服务器(使用代理),通过 sftp 获取一些文件。通常效果很好。在随机的一天,我遇到了以下错误。根本原因可能是什么?
sftp> mget TR_ACK*.txt
Bad packet length 1131376238.
ssh_dispatch_run_fatal: Connection to UNKNOWN port 65535: Connection corrupted
Connection closed
编辑:仅供参考 - 我们的脚本每 5 分钟运行一次。上述问题发生于中午 12 点 05 分。12:00 分钟的运行也失败,因为服务器在 12:00 关闭。就在 12 点 05 分之前,服务器才启动。
所以我使用代理进行 API 调用,如下所示:
vue.config.js:
module.exports = {
devServer: {
proxy: 'http://www.pathofexile.com/'
}
}
Run Code Online (Sandbox Code Playgroud)
xxx.vue:
axios.get("http://localhost:8080/api/public-stash-tabs").then..
Run Code Online (Sandbox Code Playgroud)
这有效!现在,当我也想从不同的站点进行 API 调用时,我不知道该怎么做。我想要的是这样的东西:
vue.config.js:
module.exports = {
devServer: {
proxy: {
'http://localhost:8080/one/': {
target: 'http://www.pathofexile.com/',
changeOrigin: true
},
'http://localhost:8080/two/': {
target: 'https://api.poe.watch/',
changeOrigin: true
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
xxx.vue:
axios.get("http://localhost:8080/one/api/public-stash-tabs").then..
axios.get("http://localhost:8080/two/id").then..
Run Code Online (Sandbox Code Playgroud)
但似乎什么也没发生,我收到 404 错误,因为它尝试从 http://localhost:8080/api/public-stash-tabs获取某些内容
我是否走在正确的轨道上,我是否错过了一些东西?或者这不是要走的路?
我已经从anacoda安装了python 3.7。无法通过 pip 或 conda 安装任何新软件包。配置环境变量、代理等。但我仍然收到以下错误
raise ProxySchemeUnknown(proxy.scheme) pip._vendor.urllib3.exceptions.ProxySchemeUnknown:不支持代理方案无
有没有人解决这个错误?
我有一些代理应用程序,例如 Ultra-surf 或 Tor 浏览器。我可以在浏览器或其他应用程序中设置他们的代理。例如,对于 Tor,我可以在任何应用程序中将ocks: 设置为“127.0.0.1:9150”。
但我想使用这个代理来执行 CMD。
我看到了这些答案
netsh winhttp set proxy proxy-server="socks=localhost:9090" bypass-list="localhost"
或者
set HTTP_PROXY=http://proxy_userid:proxy_password@proxy_ip:proxy_port
我以管理员身份打开了 CMD,然后尝试了这些命令。在每一个网站之后,我测试了 3 个网站:“google.com”、“facebook.com”和“youtu.be”。但注意事项发生了变化。“google.com”始终有效,而“facebook.com 和 youtu.be”则无效。另外,我的代理应用程序是否打开并没有什么区别。有人知道如何为 CMD 设置这种代理吗?
netsh winhttp set proxy 127.0.0.1:1080
netsh winhttp set proxy proxy-server="socks=127.0.0.1:9150" bypass-list="127.0.0.1"
netsh winhttp set proxy proxy-server="socks=localhost:9150" bypass-list="localhost"
netsh winhttp set proxy proxy-server="http=127.0.0.1:1080" bypass-list="127.0.0.1"
netsh winhttp set proxy proxy-server="https=127.0.0.1:1080" bypass-list="127.0.0.1"
set HTTP_PROXY=127.0.0.1:1080
set HTTPs_PROXY=127.0.0.1:1080
set HTTP_PROXY=@127.0.0.1:1080
set HTTPs_PROXY=@127.0.0.1:1080
set HTTP_PROXY=:@127.0.0.1:1080
set HTTPs_PROXY=:@127.0.0.1:1080
Run Code Online (Sandbox Code Playgroud)
ping 响应始终是:
对于未检测到的站点:
C:\>ping google.com
Pinging google.com [172.217.18.142] with 32 bytes of …Run Code Online (Sandbox Code Playgroud) 如果您必须在不同环境中测试资源,您可以使用 postman 环境变量来指定环境特定值。但是,如果只有部分环境使用代理,则必须设置 Postman 设置,并在每次针对该环境运行测试时手动启用/禁用它。这很烦人并且缺乏自动化。如果不同的环境使用不同的代理,情况会变得更糟。
此外,当您导出环境和集合时,代理配置仍保留在 Postman 中。它不被导出。因此,您必须在某处记录它,以避免丢失配置,因为没有环境的注释来记录它。
问题是:有没有办法根据环境应用代理配置?例如,指定一些Postman环境变量。
尝试使用 Google 的 Oauth 代理服务和 Grafana 的 Auth 代理配置,但 Grafana 仍然显示登录表单。
Google 登录对话框按预期显示,但经过身份验证后,预计用户将由 Grafana 进行身份验证。
设置:为 ingress-nginx 启用 Kubernetes (AWS/EKS) Oauth 代理
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: oauth2-proxy
namespace: monitoring
spec:
rules:
- host: grafana.*domain*
http:
paths:
- backend:
serviceName: oauth2-proxy
servicePort: 4180
path: /oauth2
...
tls:
- hosts:
- grafana.*domain*
Run Code Online (Sandbox Code Playgroud)
Grafana 入口:
...
Rules:
Host Path Backends
---- ---- --------
grafana.*domain*
/ prometheus-operator-grafana:80 (192.168.2.91:3000)
Annotations: helm.fluxcd.io/antecedent: monitoring:helmrelease/prometheus-operator
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/auth-signin: https://$host/oauth2/start?rd=$escaped_request_uri
nginx.ingress.kubernetes.io/auth-url: https://$host/oauth2/auth
Run Code Online (Sandbox Code Playgroud)
Grafana.ini:根据https://grafana.com/docs/grafana/latest/auth/auth-proxy/
[analytics]
check_for_updates = …Run Code Online (Sandbox Code Playgroud) Chrome/Chromium 似乎支持代理的命令行参数,来自标准的 http、https 代理,但也支持 UDP 代理,这对于代理 QUIC 或 HTTP/3 网站(例如 Google 自己的网站)很有用。
我只能找到:
如果 Chrome 提供了配置 UDP/QUIC/HTTP3 代理的功能,那么是否还有一个类似鱿鱼的转发代理支持 UDP 而不仅仅是 TCP 作为底层协议?
我已在运行 Windows 10 专业教育版(64 位)的开发人员计算机上下载并安装了 PostgreSQL 12(64 位)。
当安装到Stack Builder下载应用程序列表步骤时,出现错误如下:
访问https://www.postgresql.org/applications-v2.xml schannel时遇到认证验证问题:next InitializeSecurityContext 失败:未知错误 (0x80092013) - 吊销功能无法检查吊销,因为吊销服务器已脱机。这意味着无法验证源下载。建议您不要继续下载,因为它可能来自冒充预期下载站点的网站,并且可能包含病毒或恶意软件。
你想继续吗?
我尝试使用参考此答案的代理服务器。https://serverfault.com/questions/555125/postgresql-stack-builder-installation-proxy-setting-on-windows
我也尝试过该问题的两种解决方案。尽管如此,我还是无法下载应用程序列表。
我想安装 PostGIS。看起来堆栈构建器安全且易于使用。我应该怎么做才能安装 PostGIS?
proxy ×10
http ×2
aws-lambda ×1
cmd ×1
ftp ×1
grafana ×1
installation ×1
kubernetes ×1
linux ×1
nginx ×1
oauth ×1
postgis ×1
postgresql ×1
postman ×1
server ×1
serverless ×1
sftp ×1
ssh ×1
udp ×1
vue-cli ×1
vue.js ×1
webpack ×1
windows ×1