diff options
Diffstat (limited to 'cgi-bin/sop_preview_proxy.pl')
-rwxr-xr-x | cgi-bin/sop_preview_proxy.pl | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/cgi-bin/sop_preview_proxy.pl b/cgi-bin/sop_preview_proxy.pl new file mode 100755 index 0000000..0694e11 --- /dev/null +++ b/cgi-bin/sop_preview_proxy.pl | |||
@@ -0,0 +1,28 @@ | |||
1 | #!/usr/bin/perl | ||
2 | |||
3 | # | ||
4 | # Perl Based Same Origin Proxy | ||
5 | # | ||
6 | |||
7 | $|=1; | ||
8 | |||
9 | srand; | ||
10 | use strict; | ||
11 | |||
12 | use Apache::Request; | ||
13 | use LWP::Simple; | ||
14 | use LWP::UserAgent; | ||
15 | |||
16 | my $r = Apache::Request->new(Apache->request); | ||
17 | $r->send_http_header('text/javascript'); | ||
18 | |||
19 | my @url = split(/site=/,$r->parsed_uri()->unparse()); | ||
20 | |||
21 | my $browser = LWP::UserAgent->new; | ||
22 | $browser->credentials( | ||
23 | 'admin.santoprene.com:80', | ||
24 | 'Admin', | ||
25 | 'DESIGNER_SOP_USER' => 'dsop4edit' | ||
26 | ); | ||
27 | |||
28 | print $browser->get($url[1])->content; | ||