支持智能管道/多路复用的代理服务器
因此,我想开发一个代理服务器,当连接时检查它将下载到代理的内容的大小(最有可能使用 head),如果它超过设定的大小,它会通过管道和使用范围将请求的下载分成一般大小合适(1 MB 或可能使用配置文件)的段。然后,当它下载它并旋转管道时,我希望它能够将它得到的内容(按顺序)反馈给客户端,这样如果是媒体流,它将能够轻松播放它。目标是将太大的管道分成管道,而将较小的管道分开。我有点不确定从哪里开始。我确实找到了其他代理服务器(polipo),可以如上所述进行管道/多路复用,但没有一个像上面概述的那样工作。那么 A. 是否存在这样的东西 B. 我该如何开始? (如果可能的话,我更喜欢用Python工作)
So, I want to develop a proxy server that when contacted checks the size of what it will be downloading to proxy (using head most likely) and if it's over a set size it splits the download of the request via pipelining and using Range into generally good sized (1 megabyte or possibly using a config file) segments. Then as it downloads it and rotates the pipes I want it to feed back to it's client what it gets (in order), so that if it is say a stream of media it will be able to play it easily. The goal is to split too large ones into pipelines and the smaller ones to leave them alone. I am sorta unsure where to start. I did find other proxy servers (polipo) that could do pipelining/multiplexing as mentioned but none worked as outlined above. So A. does anything exist that does it and B. how would i get started? (I would prefer to work in python if possible)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我会看看twisted http://twistedmatrix.com/trac/ 它是一个很棒的基于事件的网络库Python。这需要一些时间来适应,但它在这种事情上做得很好。
I would look at twisted http://twistedmatrix.com/trac/ it is an great event based networking library for python. It takes a bit of getting used to, but it does this kind of thing very well.