473,322 Members | 1,259 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

mod_python preprocess/filter before proxy


Hi!

I've seen the message below in this python list, that seems to be
unanswered.

I'm trying to do the pretty same thing.

There's a way to preprocess the request with a mod_python handler and then
proxying it with mod_proxy?

Thank you very much in advance, and sorry for trying to revive such an old
message.

Cheers.

>
whale whale at mycameo.com
Tue Mar 25 05:49:42 CET 2003

I use Apache2.0.44 and mod_python3.0.1.
I add ProxyPass and PythonHandler directives in httpd.conf
## httpd.conf
ProxyPass /test/ http://www.test.com
ProxyPassReverse /test/ http://www.test.com
<Location />
AddHandler python-program .htm .html
PythonHandler mptest
</Location
And mptest.py:
from mod_python import apache
def handler(req):
req.write('Hello!!')
return apache.OK

ex. My apache server is www.server.com.
When I browsed the local server request(ex.
http://www.server.com/1.html),
I received 'Hello!!' response, the python handler worked well.
But when I browse the proxy request(ex.
http://www.server.com/test/1.html),
the response I received is the original content of
http://www.test.com/1.html, not 'Hello!!'.
The proxy requests didn't seem to be processed by mod_python handler.
How could I pre-process the proxy request before mod_proxy module?
Thanks a lot!!


---
David Sanchez Martin
Administrador de Sistemas
ds******@e2000.es
GPG Key ID: 0x37E7AC1F

E2000 Nuevas Tecnologías
Tel : +34 902 19 61 77

Sep 27 '07 #1
1 2284
Yes, use PythonInputFilter directive to specify an input filter.

http://www.modpython.org/live/curren...filter-if.html

Input filters which modify the length of the data may be an issue
though when doing proxying however.

If you cant work it out, possibly more appropriate to take your
questions to the official mod_python mailing list referenced on the
mod_python site.

Graham

On Sep 27, 9:26 pm, David Sánchez Martín <dsanc...@e2000.eswrote:
Hi!

I've seen the message below in this python list, that seems to be
unanswered.

I'm trying to do the pretty same thing.

There's a way to preprocess the request with a mod_python handler and then
proxying it with mod_proxy?

Thank you very much in advance, and sorry for trying to revive such an old
message.

Cheers.


whale whale at mycameo.com
Tue Mar 25 05:49:42 CET 2003
I use Apache2.0.44 and mod_python3.0.1.
I add ProxyPass and PythonHandler directives in httpd.conf
## httpd.conf
ProxyPass /test/ http://www.test.com
ProxyPassReverse /test/ http://www.test.com
<Location />
AddHandler python-program .htm .html
PythonHandler mptest
</Location>
And mptest.py:
from mod_python import apache
def handler(req):
req.write('Hello!!')
return apache.OK
ex. My apache server iswww.server.com.
When I browsed the local server request(ex.
http://www.server.com/1.html),
I received 'Hello!!' response, the python handler worked well.
But when I browse the proxy request(ex.
http://www.server.com/test/1.html),
the response I received is the original content of
http://www.test.com/1.html, not 'Hello!!'.
The proxy requests didn't seem to be processed by mod_python handler.
How could I pre-process the proxy request before mod_proxy module?
Thanks a lot!!

---
David Sanchez Martin
Administrador de Sistemas
dsanc...@e2000.es
GPG Key ID: 0x37E7AC1F

E2000 Nuevas Tecnologías
Tel : +34 902 19 61 77

David Sánchez Martín.vcf
1KDownload

smime.p7s
1KDownload

Sep 27 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Kylotan | last post by:
I thought mod_python would be the answer to my CGI performance issue, but I can't seem to make much sense out of it. All the examples are too trivial to be of much use. Given that I have an...
2
by: Robert J. Hansen | last post by:
I'm not entirely certain comp.lang.python is the proper newsgroup for mod_python questions, but "comp.lang.python.web" doesn't seem to exist, so... my apologies in advance if this is considered...
3
by: Charles | last post by:
Hello, I'm think about using mod_python for a project but I need to make sure: Does mod_python time out after a minute ? (I hope not). If I leave an HTTP connection open so that the content keeps...
3
by: Michael | last post by:
Hey everyone, Is it possible to automatically insert headers/footers using mod_python? I will be not be using PSP's, so I cannot use the PSP/include solution. Furthermore, the header will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.