简体   繁体   English

使用Amazon EC2作为PHP cURL的代理

[英]Using Amazon EC2 as a proxy for PHP cURL

I'm new to Amazon Web Services/EC2. 我是Amazon Web Services / EC2的新手。 Would it be possible to setup a private proxy that I could connect to through PHP cURL? 是否可以设置可以通过PHP cURL连接到的私有代理?

An important caveat is that it should be possible to access from a shared host which I don't have physical access to.. The solutions I've seen elsewhere seem to require that you use a specific local machine to access it. 一个重要的警告是应该可以从我没有物理访问权限的共享主机进行访问。我在其他地方看到的解决方案似乎要求您使用特定的本地计算机来访问它。

If you setup Squid on the EC2 server and restrict it by username and password AND/OR IP address it would be just fine. 如果您在EC2服务器上设置Squid并通过用户名和密码和/或IP地址对其进行限制,那就很好了。 As long as your second server (even shared host) has PHP cURL support you should be fine, as you can define username and password you want to use to access the proxy server while making a curl request. 只要您的第二台服务器(甚至共享主机)具有PHP cURL支持,就可以了,因为您可以在发出curl请求时定义要用于访问代理服务器的用户名和密码。 You can use the IP of the shared box to secure your proxy server, so that other people don't start abusing it. 您可以使用共享框的IP保护代理服务器的安全,以便其他人不会开始滥用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM