• Publicidad

HTTP::Proxy para GET

¿Apenas comienzas con Perl? En este foro podrás encontrar y hacer preguntas básicas de Perl con respuestas aptas a tu nivel.

HTTP::Proxy para GET

Notapor BigBear » 2014-01-02 08:39 @402

Hola. Tengo el siguiente código.

Sintáxis: [ Descargar ] [ Ocultar ]
Using perl Syntax Highlighting
  1. use HTTP::Proxy;
  2. use HTTP::Proxy::BodyFilter::simple;
  3. use HTTP::Proxy::BodyFilter::complete;
  4. use Data::Dumper;
  5.  
  6. my $server = HTTP::Proxy->new(port=>8080);
  7. $server->host();
  8.  
  9. $server->push_filter(mime=>undef,response => HTTP::Proxy::BodyFilter::complete->new());
  10.  
  11. $server->push_filter(
  12. mime=>undef,
  13. request=>HTTP::Proxy::BodyFilter::simple->new(\&enable),
  14. response => HTTP::Proxy::BodyFilter::simple->new(\&enable2));
  15.  
  16. $server->start();
  17.  
  18. sub enable {
  19.  
  20.     my($a,$b,$c,$d,$e) = @_;
  21.  
  22. print $c->header("content");
  23.  
  24.     #print Dumper $c;
  25.  
  26. }
  27.  
  28. sub enable2 {
  29.  my ($j,$k,$l,$m,$n) = @_;
  30.   print $$k;
  31. }
Coloreado en 0.002 segundos, usando GeSHi 1.0.8.4


El tema es que ya sé capturar el contenido POST y modificarlo a mi antojo, que sería así:

Sintáxis: [ Descargar ] [ Ocultar ]
Using perl Syntax Highlighting
  1. print $c->content;
  2. $c->content("testing")
Coloreado en 0.001 segundos, usando GeSHi 1.0.8.4


Ahora quiero hacer lo mismo con el contenido de un GET para modificarlo como lo hice con el POST.

¿ Alguien me puede ayudar ?
BigBear
Perlero frecuente
Perlero frecuente
 
Mensajes: 981
Registrado: 2009-03-01 18:39 @818

Publicidad

Volver a Básico

¿Quién está conectado?

Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 1 invitado