0

I'm using CFHTTP to post data to my payment gateway (Protx).

Protx requires that I whitelist the IP that will send this request.

I am hosted on a shared server running Windows 2008.

This morning, my hosting company assigned a new IP to this server for a customer who required an SSL certificate. Since then, my CFHTTP post appears to be coming from this new IP (which was not on the Protx whitelist).

My hosting company, being the worst imaginable, doesn't know why this is and aren't willing to look into it further.

Does anyone have any idea how I can specify which referring IP address CFHTTP will use to post data?

4

2 回答 2

2

您本质上想要做的是欺骗您传递给 Protx 的 IP 地址。

这可以使用 cfhttparam 标签来完成。

<cfhttpparam type="header" name="host" value="">

前任。

<cfhttpparam type="header" name="host" value="10.1.1.1">

有关更多信息,请参阅Nabble 帖子,还请查看cfhttpparam的livedocs

于 2008-12-10T18:35:57.313 回答
2

我不相信这是直接可能的。CF 将依赖底层操作系统来处理 TCP/IP 请求,因此操作系统将确定将用于请求的 IP。可以通过指定主机标头来欺骗 IP,但我不确定如何做到这一点或效果如何。

首先,我建议您让 Protx 将新 IP 列入白名单。

其次,如果您有可用的代理服务器,这可能会提供解决方案。CFHTTP 可以使用代理,您可以将代理的 IP 列入白名单。这样,无论 CFHTTP 在哪个 IP 上,Protx 服务器都会看到代理的地址。

于 2008-12-10T18:38:07.623 回答