如何将Laravel Sail实例与SSH隧道联系起来?

发布于 2025-01-23 21:30:40 字数 511 浏览 3 评论 0原文

我有一个Laravel应用程序,它需要连接到具有非常严格访问要求的安全外部API。 AWS上有一个托管的处理程序,该处理程序具有一堆签名的证书等。由于这些要求,通过该特定服务器连接该API的唯一方法。

现在,要在本地计算机上测试内容,我将执行以下操作:

  1. SSH使用-D标志来设置袜子代理。
  2. 使用这将袜子袜子袜子转换代理。
  3. 设置Postman的代理设置以使用该HTTP代理。

一切都很好,我可以按预期完成请求。

但是,我也希望能够在当地的Laravel环境中使用代理,我使用帆。

问题是我不确定如何使容器与代理进行交互。使用本地计算机中的上面方法,我可以curl所需的端点恰好,但是如果我尝试通过容器本身进行操作,则拒绝连接。

任何帮助将不胜感激!

I have a Laravel app which needs to connect to a secure external API with very strict access requirements. There is a handler hosted on AWS which has a bunch of signed certificates etc. The only way to connect to that API is via that specific server due to those requirements.

Now, to test things on my local machine, I do the following:

  1. SSH to the server using the -D flag to set up a SOCKS proxy.
  2. Use this socks to http package to convert the proxy.
  3. Set up Postman's proxy settings to use that http proxy.

That all works fine and I can complete the requests as expected.

However, I'd like to be able to use the proxy in my local Laravel environment too, for which I use Sail.

The problem is that I'm unsure of how to get the container to interact with the proxy. Using the method above in my local machine, I can cURL the required endpoint just fine, but if I try to do it via the container itself, it refuses to connect.

Any help would be appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文