CGI URL Encoding

 
Post new topic   Reply to topic    Aprelium Forum Index -> Perl
View previous topic :: View next topic  
Author Message
Carlos305
-


Joined: 05 Jun 2006
Posts: 3

PostPosted: Mon Jun 12, 2006 11:42 pm    Post subject: CGI URL Encoding Reply with quote

What do i need to do so when i go to a site through a cgi-proxy it wont show the name of the site on the address bar?

For Example: If i put myspace.com in the proxy it shows
Code:

http://mydomain.com/nph-proxy.cgi/010110A/http/myspace.com/

i want it to show it like this

Code:
http://pbp.iamnewguy.com/perl/nph-proxy.pl/000110A/687474703a2f2f6d7973706163652e636f6d2f


I dont want the http/myspace.com/ to come out
Back to top View user's profile Send private message
RTAdams89
-


Joined: 06 Nov 2005
Posts: 102

PostPosted: Mon Jun 12, 2006 11:49 pm    Post subject: Reply with quote

The proxy you are using needs to have "encode-url" enabled. Or if you are running your own (CGIProxy) you need to enable it in the configuration. I believe you can use base64 or 13-letter shift.
Back to top View user's profile Send private message
Carlos305
-


Joined: 05 Jun 2006
Posts: 3

PostPosted: Tue Jun 13, 2006 1:19 am    Post subject: Reply with quote

i uncommented this
Code:
sub proxy_encode {
    my($URL)= @_ ;
   $URL=~ s#^([\w+.-]+)://#$1/# ;                 # http://xxx -> http/xxx
#    $URL=~ s/(.)/ sprintf('%02x',ord($1)) /ge ;   # each char -> 2-hex
#    $URL=~ tr/a-zA-Z/n-za-mN-ZA-M/ ;              # rot-13

    return $URL ;
}

sub proxy_decode {
    my($enc_URL)= @_ ;

#    $enc_URL=~ tr/a-zA-Z/n-za-mN-ZA-M/ ;        # rot-13
#    $enc_URL=~ s/([\da-fA-F]{2})/ sprintf("%c",hex($1)) /ge ;
   $enc_URL=~ s#^([\w+.-]+)/#$1://# ;           # http/xxx -> http://xxx
    return $enc_URL ;
}


so that is looked like this


Code:
sub proxy_encode {
    my($URL)= @_ ;
#   $URL=~ s#^([\w+.-]+)://#$1/# ;                 # http://xxx -> http/xxx
#    $URL=~ s/(.)/ sprintf('%02x',ord($1)) /ge ;   # each char -> 2-hex
    $URL=~ tr/a-zA-Z/n-za-mN-ZA-M/ ;              # rot-13

    return $URL ;
}

sub proxy_decode {
    my($enc_URL)= @_ ;

    $enc_URL=~ tr/a-zA-Z/n-za-mN-ZA-M/ ;        # rot-13
#    $enc_URL=~ s/([\da-fA-F]{2})/ sprintf("%c",hex($1)) /ge ;
#   $enc_URL=~ s#^([\w+.-]+)/#$1://# ;           # http/xxx -> http://xxx
    return $enc_URL ;
}


but it still doesn;t work
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> Perl All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group