邮递员无法到达本地主机

编程入门 行业动态 更新时间:2024-10-24 08:24:58
本文介绍了邮递员无法到达本地主机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在公司环境中,因此必须使用代理来访问服务器。这在邮递员和浏览器中效果很好。我无法到达的是邮递员中的localhost,但是我可以在浏览器中到达localhost。

I am in a corporate env so I have to use a proxy to reach servers. This works well in postman and in browsers. What I can't reach is localhost in postman but I can reach localhost in the browser.

我正在运行Postman for Linux Version 6.0.9。我尝试使用全局代理和系统代理都已打开以及已打开和未打开的状态到达localhost:9082 / rest / myapi ....和127.0.0.1:9082/rest/myapi。在所有情况下,我都无法访问本地主机。

I am running Postman for Linux Version 6.0.9. I have tried reaching localhost:9082/rest/myapi.... and 127.0.0.1:9082/rest/myapi with both global proxy and system proxy turned on and with either turned on and with non turned on. In all cases I am not able to reach localhost.

作为响应,我得到的是来自代理服务器的错误页面!某种程度上,呼叫从网络上发出,而不是保留在我的机器上。

What I get as an response is an error page from the proxy server! Someway the call gets out on the network instead of being kept on my machine.

邮递员控制台:

我的请求标头是:

Cache-Control →no-cache Connection →Keep-Alive Content-Length →986 Content-Type →text/html; charset=utf-8 Pragma →no-cache Proxy-Connection →Keep-Alive

我的响应标头是:

cache-control:"no-cache" pragma:"no-cache" content-type:"text/html; charset=utf-8" proxy-connection:"Keep-Alive" connection:"Keep-Alive" content-length:"986"

我的回复正文是HTML页面。

My response body is an html page.

如何与邮递员通话 localhost ?

推荐答案

我找到了一个临时解决方案:

I found a temporary solution:

在终端中,转到安装邮递员的目录并添加:

In terminal, go to the directory where postman is installed and add:

machine@dev:~/Documents/Postman$ export NO_PROXY=localhost,127.0.0.1 machine@dev:~/Documents/Postman$ ./Postman

这将使对本地主机的调用正常工作。

This will make calls to localhost work.

我在Windows计算机上发现了类似的问题此处

I found a similar problem on Windows machines here

更多推荐

邮递员无法到达本地主机

本文发布于:2023-10-29 04:01:43,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1538666.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:邮递员   主机

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!