|
|
@@ -38,6 +38,7 @@ from noise.connection import NoiseConnection, Keypair |
|
|
|
import argparse |
|
|
|
import asyncio |
|
|
|
import base64 |
|
|
|
import functools |
|
|
|
import os.path |
|
|
|
import shutil |
|
|
|
import socket |
|
|
@@ -250,7 +251,9 @@ def parsesockstr(sockstr): |
|
|
|
return proto, args |
|
|
|
|
|
|
|
async def connectsockstr(sockstr): |
|
|
|
'''Wrapper for asyncio.open_*_connection.''' |
|
|
|
'''Wrapper for asyncio.open_*_connection. |
|
|
|
|
|
|
|
For the format of sockstr, please see parsesockstr.''' |
|
|
|
|
|
|
|
proto, args = parsesockstr(sockstr) |
|
|
|
|
|
|
@@ -264,7 +267,7 @@ async def connectsockstr(sockstr): |
|
|
|
return reader, writer |
|
|
|
|
|
|
|
async def listensockstr(sockstr, cb): |
|
|
|
'''Wrapper for asyncio.start_x_server. |
|
|
|
'''Wrapper for asyncio.start_*_server. |
|
|
|
|
|
|
|
For the format of sockstr, please see parsesockstr. |
|
|
|
|
|
|
@@ -505,6 +508,7 @@ async def NoiseForwarder(mode, encrdrwrr, connvalid, priv_key, pub_key=None): |
|
|
|
# Slightly modified to timeout and to print trace back when canceled. |
|
|
|
# This makes it easier to figure out what "froze". |
|
|
|
def async_test(f): |
|
|
|
@functools.wraps(f) |
|
|
|
def wrapper(*args, **kwargs): |
|
|
|
async def tbcapture(): |
|
|
|
try: |
|
|
|