devunt / warp Goto Github PK
View Code? Open in Web Editor NEWSimple http proxy which is written in python in order to bypass http://warning.or.kr
Simple http proxy which is written in python in order to bypass http://warning.or.kr
You can use standard Connecton
, as Proxy-Connection
is, according to Wiki, Implemented as a misunderstanding of the HTTP specifications. Common because of mistakes in implementations of early HTTP versions. Has exactly the same functionality as standard Connection field. For more details seee the Proxy-Connection: header is a mistake in how some web browsers use HTTP.
But because some clients, curl for instance, send Proxy-Connection
some fallback may be needed. Though neither is required by the spec.
Specifically, current implementation doesn't work with aiohttp proxy connector which sends Connection
header.
Most asyncio
-based libraries and asyncio
itself take optional loop
argument. Useful for testing as described here.
Header regexes and header name comparisons should be case insensitive because different clients send them in different ways.
try:
accept = functools.partial(accept_client, loop=loop)
yield from asyncio.start_server(accept, host=host, port=port, loop=loop)
except error as e:
logger.critical('!!! Fail to bind server at [%s:%d]: %s' % (host, port, e.args[1]))
return 1
logger.info('Server bound at [%s:%d].' % (host, port))
NameError: name 'error' is not defined
is there because error
, obviously, is not a builtin. To catch address-already-in-use OSError
should be used.
Return asyncio.Server
from start_warp_server
so it can later be stopped programmatically. E.g. in tearDown
of a test case.
Also returning 1
from start_warp_server
in case of the error doesn't make sense (if you didn't really mean sys.exit(1)
). So it's better to make it either return asyncio.Server
or raise.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.