473,800 Members | 2,640 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTTP Proxy server in python


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 twohours
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

Jul 18 '05 #1
3 5758
On Mon, 31 May 2004 23:13:33 -0600 (MDT), Muhammad Ali
<mu**********@s pymac.com> wrote:

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.
Jul 18 '05 #2
Muhammad Ali wrote:
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.
Jul 18 '05 #3
On Wed, 02 Jun 2004 02:03:26 +0200, Ludovico Magnocavallo
<lu**@asiatica. org> wrote:
Muhammad Ali wrote:
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.


A place to buy sticks can be found here

http://www.sticks.org/buy_sticks.htm

In case you go with the "hitting with sticks" solution.
<{{{*>

..

Jul 18 '05 #4

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

Similar topics

8
11794
by: Chris Gray | last post by:
Is there such a beast? In particular, I'm looking for a production-quality proxy server fully compliant with HTTP/1.1 written in Python. If there isn't, is there anything that comes close? Thanks for any help you can throw my way, Chris Gray "Okey dokey.. free my mind. Right, no problem, free my mind, free my mind,
2
5611
by: Fuzzyman | last post by:
Xavier Defrang has written an HTTP Debugging Proxy. This message is basically for him - since he says on his website that he inhabits this newsgroup. I downloaded this and ran it , with the following result : >>> Traceback (most recent call last): File "D:\Python Projects\cgiproxy\http_debugging_proxy.py", line 34, in ? signal.signal(signal.SIGALRM, SIGALRM_handler)
7
9292
by: Michael Foord | last post by:
#!/usr/bin/python -u # 15-09-04 # v1.0.0 # auth_example.py # A simple script manually demonstrating basic authentication. # Copyright Michael Foord # Free to use, modify and relicense. # No warranty express or implied for the accuracy, fitness to purpose
0
2151
by: Carl Waldbieser | last post by:
**** Post for FREE via your newsreader at post.usenet.com **** When using urllib2.urlopen() on my Windows 2000 machine at work, I was puzzled that I kept getting back authentication errors from our Internet proxy server (I was trying to contact an internal machine). Upon digging into the code a little, I found that urllib2 was pulling the proxy information out of the Windows registry (Internet Explorer uses these settings). However,...
5
9855
by: yoda | last post by:
I've recently configured my network such that I use squid as a http proxy. I'd now like to be able to use setuptools and ez_setup via this proxy. Is this possible? If so, how do I do it? The most that the setuptools documentation says is (http://peak.telecommunity.com/DevCenter/setuptools): "....If you are behind an NTLM-based firewall that prevents Python programs from accessing the net directly, you may wish to first install and...
0
1017
by: benboals | last post by:
Note: this is in reply to a message from August 2 which i found searching for help on my own problem. I couldn't seem to reply to it, but a friend suggested that simply using the same subject would put it in that thread. In case he's wrong, i quoted the previous comments . Odd-R. wrote: > I use the following piece of code to contact a webservice, > and read a wsdl file. > > from SOAPpy import WSDL > from SOAPpy import URLopener
0
2459
by: Alimah | last post by:
My objective is to log onto a wiki account (specifically wikipedia) using the http proxies provided by them (145.97.39.130 - 145.97.39.140:80). The operating system is Windows XP/Windows Server 2003. Or more conveniently, what do I need to change in the standard python library so that all python>>internet interaction would be done through a proxy? (I'm guessing urlib2.py?) I have a program login.py (full script:...
0
1928
by: Dan Lenski | last post by:
Hi all, I've recently written an HTTP proxy server for the Motorola E815 cell phone, based on Suzuki Hisao's "Tiny HTTP Proxy" (http:// www.okisoft.co.jp/esc/python/proxy/). This cell phone allows free Internet access if you change the default proxy server, but it has a severely buggy HTTP client implementation which will freeze if there's no Content-Length header. Basically, it's impossible to read normal web pages without some...
0
1271
by: Astan Chee | last post by:
Hi, Im trying to implement the logic from http://www.hypothetic.org/docs/msn/general/http_connections.php to a simple python code using urllib2 and some parts of urllib. Im behind a http proxy that requires authentication that is why Im using urllib2. Im asking for help on how to send commands in a body of a HTTP before requesting for response. What am I doing wrong? I only get the response from the server but my commands never seem to be...
0
9690
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9550
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10501
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10250
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5603
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2944
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.