print upstream proxy
This commit is contained in:
parent
34734bb7e4
commit
69e9a75d15
@ -267,15 +267,17 @@ class MainHandler(tornado.web.RequestHandler):
|
|||||||
self.write("Stream not found. (invalid upstream)")
|
self.write("Stream not found. (invalid upstream)")
|
||||||
else:
|
else:
|
||||||
upstream_proxy = await handler.proxy.proxy_url(upstream, None)
|
upstream_proxy = await handler.proxy.proxy_url(upstream, None)
|
||||||
|
logger.info(upstream_proxy)
|
||||||
ctype = await handler.proxy.content_type(upstream_proxy)
|
ctype = await handler.proxy.content_type(upstream_proxy)
|
||||||
self.set_header("Content-Type", ctype)
|
self.set_header("Content-Type", ctype)
|
||||||
if ctype == "application/vnd.apple.mpegurl":
|
if redir:
|
||||||
async with handler.proxy.local() as session:
|
if ctype == "application/vnd.apple.mpegurl":
|
||||||
resp = await session.get(upstream_proxy)
|
async with handler.proxy.local() as session:
|
||||||
data = await resp.read()
|
resp = await session.get(upstream_proxy)
|
||||||
self.write(data)
|
data = await resp.read()
|
||||||
elif redir:
|
self.write(data)
|
||||||
self.redirect(upstream_proxy, status=303)
|
else:
|
||||||
|
self.redirect(upstream_proxy, status=303)
|
||||||
|
|
||||||
async def get(self):
|
async def get(self):
|
||||||
await self.handle_any(True)
|
await self.handle_any(True)
|
||||||
|
Loading…
Reference in New Issue
Block a user