Http php proxy server

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-30 12:09:29

问题


how to recover a a url along with the message which it sends form a client system in the proxy server.there is any command to recover the url and take the message out of the url in the proxy server before forwarding the url to Internet.

For Example:

http://companion_proxy/ocl.cgi?req=cnc_cmd;target=12;action=setchannel;channel=34

this is the url is typed in address bar,then how to recover the above url and the message such as

target=12,action=setchannel,channel=34,req=cnc_cmd from the url.

I have to extract the information from url in proxy server before the proxy server is forwarding the url to internet. Thanks in advance.


回答1:


The $_SERVER variable holds the information you need:

http://php.net/manual/en/reserved.variables.server.php

Specifically:

$_SERVER['SERVER_NAME']

and

$_SERVER['REQUEST_URI']

and

$_SERVER['QUERY_STRING']



回答2:


$uri = $_SERVER["REQUEST_URI"];
echo str_replace("/ocl.cgi?req=cnc_cmd;", "", $uri);



回答3:


Go for Below code you can debug and find what you want...

echo "<pre>";
print_r($_SERVER);
echo "</pre>";


来源:https://stackoverflow.com/questions/6569989/http-php-proxy-server

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!