|
|
 | | Setting up. | |
Obviously, since this thing is written in PERL, you'll need an
PERL-interpreter on your system. If you are on a *nix/Linux system you
most certainly have one there by default. If running on a Win32 system
(e.g Win NT/2k) there is great distribution of PERL available freely at
| | |  | | Checklist |
-
Put this script accessible from your HTTP-server and make sure it is
chmodded as executable. (e.g /cgi-bin/rpcproxy.cgi)
-
Modify the topmost line of this script to match the path to your PERL
executable. On UNIX you probably use #!/perl/bin/perl,
on a Win32 box #!perl should be sufficient.
-
Making sure you have everything works, open up your favorite browser and
adress the script from the addressbar. (http://www.mydomain.tld/cgi-bin/rpcproxy.cgi)
If you get a HTTP 403 in response all should be fine. This is the default
response for a GET-request or a POST not having the credentials to be
proxied. If you are getting anything else in return (500/501) you must
step back and re-check step 1 and 2 again
-
Go through the userdefinables section at the top of rpcproxy.cgi to tune it
for your needs. Access-logging is turned off by default, so if you
want to monitor usage, you'll have to switch it on.
-
Now, the world of remote RPC-services is yours...
Of course you need to know a fair piece of the DOM, XML and the XML-RPC
service specification, but that is horse of different color not covered
here.
| | |  | | A Clientside Example |
// Browserside example for a remote call // via rpcproxy Mozilla 0.8.2+/MSIE 5+ (Win32) var sRPCService = 'http://www.remote.tld/rpc-server'; var sRPCProxy = 'http://www.local.tld/cgi-bin/rpcproxy.cgi'; var oXMLHTTP = (typeof ActiveXObject != 'undefined') ? new ActiveXObject('Microsoft.XMLHTTP') : new XMLHttpRequest(); oXMLHTTP.open('POST', sRPCProxy, false); oXMLHTTP.setRequestHeader('X-Proxy-Request', sRPCService); oXMLHTTP.setRequestHeader('X-Compress-Response', 'gzip'); oXMLHTTP.send([object XMLDomDocument]); var oXMLDOM = oXMLHTTP.responseXML; // ... do stuff with incoming oXMLDOM ...
| | |  | | Access Logging. | |
Rpcproxy can be enabled to log all proxied traffic,
the logformat is 99% NCSA Common compatible (Apache style)
and gives detailed information about the traffic.
Logging is turned off by default.
| | | | |
|