HTTP Proxy server in python

M

Muhammad Ali

Hi,

I am a python newbie but have c/c++ experience.

I have a small Lan (windows 2000 sever + some win 98 machines).
The win2k connects to the internet using a dial-up connection. What i need
to do is to allow users, who would come from win98 machines to use internet
for a specific amount of time. For example, if userA has been alloted two hours
then he can no longer access internet from the win98 machine after expiring those
two hours.

I am thinking of doing a proxy server for this purpose in python that will have
a list of users and their hours, and would require logging in by the user, calculate
their times etc.

So, is this the best way of doing this? if not what else can be done? (what ever the
solution, i would like to implement in python)

If proxy server is a good idea, could someone give me an outline of how to do it?
for example, should i use a database for users (mysql?) or just a text file. How
would
i know if a user has logged off? any links on the net?

Thanks...


---- Msg sent via Spymac Mail - http://www.spymac.com
 
F

fishboy

If proxy server is a good idea, could someone give me an outline of how to do it?
for example, should i use a database for users (mysql?) or just a text file. How
would
i know if a user has logged off? any links on the net?

Well, my first thought is to write a script to harrass them
mercilessly with emails whenever they use the internet too much.

But at far as proxy, Squid is a proxy and runs on win2k. Hmmm,
outline:

1. Setup Squid
a. require passwords to use proxy
2. Setup python to analyze access.log
a. analyzing the output of a 'tail -f' would give you on the
fly data.
b. change the password of anyone over usage
c. change password back when they have more minutes.

If they all had static IPs, you could block them with ACLs instead of
passwords.

Alternatly, you could hit them with a stick when they use too much
internet. People don't like being hit with sticks. They'd prolly
stop.

It's the middle of the night here, and I'm sure someone else may have
a better idea, if this doesn't make sense.
 
L

Ludovico Magnocavallo

Muhammad said:
I am thinking of doing a proxy server for this purpose in python that will have
a list of users and their hours, and would require logging in by the user, calculate
their times etc.

So, is this the best way of doing this? if not what else can be done? (what ever the
solution, i would like to implement in python)

A list of proxy servers implemented in Python can be found here

http://xhaus.com/alan/python/proxies.html

L.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top