require caller to provide transit relay too
This commit is contained in:
parent
fae14ebe6a
commit
106991fe0d
|
@ -2,7 +2,6 @@ from __future__ import print_function
|
||||||
import re, time, threading, socket, SocketServer
|
import re, time, threading, socket, SocketServer
|
||||||
from binascii import hexlify, unhexlify
|
from binascii import hexlify, unhexlify
|
||||||
from nacl.secret import SecretBox
|
from nacl.secret import SecretBox
|
||||||
from .. import const
|
|
||||||
from ..util import ipaddrs
|
from ..util import ipaddrs
|
||||||
from ..util.hkdf import HKDF
|
from ..util.hkdf import HKDF
|
||||||
|
|
||||||
|
@ -270,8 +269,8 @@ class RecordPipe:
|
||||||
self.skt.close()
|
self.skt.close()
|
||||||
|
|
||||||
class Common:
|
class Common:
|
||||||
def __init__(self, transit_relay=None):
|
def __init__(self, transit_relay):
|
||||||
self._transit_relay = transit_relay or const.TRANSIT_RELAY
|
self._transit_relay = transit_relay
|
||||||
self.winning = threading.Event()
|
self.winning = threading.Event()
|
||||||
self._negotiation_check_lock = threading.Lock()
|
self._negotiation_check_lock = threading.Lock()
|
||||||
self._have_transit_key = threading.Condition()
|
self._have_transit_key = threading.Condition()
|
||||||
|
|
|
@ -8,7 +8,7 @@ APPID = "lothar.com/wormhole/file-xfer"
|
||||||
|
|
||||||
def receive_file(args):
|
def receive_file(args):
|
||||||
# we're receiving
|
# we're receiving
|
||||||
transit_receiver = TransitReceiver(transit_relay=args.transit_helper)
|
transit_receiver = TransitReceiver(args.transit_helper)
|
||||||
|
|
||||||
r = Receiver(APPID, args.relay_url)
|
r = Receiver(APPID, args.relay_url)
|
||||||
code = args.code
|
code = args.code
|
||||||
|
|
|
@ -10,7 +10,7 @@ def send_file(args):
|
||||||
# we're sending
|
# we're sending
|
||||||
filename = args.filename
|
filename = args.filename
|
||||||
assert os.path.isfile(filename)
|
assert os.path.isfile(filename)
|
||||||
transit_sender = TransitSender(transit_relay=args.transit_helper)
|
transit_sender = TransitSender(args.transit_helper)
|
||||||
|
|
||||||
i = Initiator(APPID, args.relay_url)
|
i = Initiator(APPID, args.relay_url)
|
||||||
code = i.get_code(args.code_length)
|
code = i.get_code(args.code_length)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user