文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>proxylet 0.1.1

proxylet 0.1.1

时间:2010-08-27  来源:lexus

proxylet 0.1.1

Lightweight HTTP reverse proxy built on eventlet

Downloads ↓

proxylet:  lightweight HTTP reverse proxy built on eventlet

This module implements a lightweight reverse proxy for HTTP, using non-blocking
IO based on the eventlet module.  It aims to do as little as possible while
supporting simple request/response rewriting and being compatible with HTTP
keep-alive.

Basic operation is via the 'serve' function, which will bind to the
specified host and port and start accepting incoming HTTP requests:

  proxylet.serve(host,port,mapper)

Here 'mapper' is a function taking a proxylet.streams.HTTPRequest object,
and returning either None (for '404 Not Found') or a 3-tuple giving the
destination host, destination port, and a rewriter object.

The rewriter can be any callable that takes request and response streams
as arguments and returns wrapped versions of them, but it will most likely
be a subclass of proxylet.relocate.Relocator.  This class has the necessary
logic to rewrite the request for proxying.

As an example of the available functionality, this mapping function will
proxy requests to /svn to a private subversion server, requests to /files
to a private fileserver, and return 404 for any other paths:

  def mapper(req):
    svn = SVNRelocator("http://www.example.com/svn","http://svn.example.com/")
    if svn.matchesLocal(req.reqURI):
      return svn.mapping  # contains the (host,port,rewriter) tuple
    if req.reqURI.startswith("/files/"):
      return ("files.example.com",80,None)
    return None
 
File Type Py Version Uploaded on Size # downloads
proxylet-0.1.1-py2.5.egg (md5) Python Egg 2.5 2009-03-18 22KB 236
proxylet-0.1.1.tar.gz (md5) Source 2009-03-18 8KB 516
 
  • Author: Ryan Kelly <ryan at rfk id au>
  • Keywords: HTTP reverse proxy
  • License: PSF
  • Package Index Owner: rfk
  • DOAP record: proxylet-0.1.1.xml

Log in to rate this package.

Website maintained by the Python community
hosting by xs4all / design by pollenation
相关阅读 更多 +
排行榜 更多 +
合合合军团

合合合军团

策略塔防 下载
街头滑板

街头滑板

体育竞技 下载
武者生存

武者生存

体育竞技 下载