require caller to provide transit relay too

This commit is contained in:
Brian Warner 2015-03-25 13:07:17 -07:00
parent fae14ebe6a
commit 106991fe0d
3 changed files with 4 additions and 5 deletions

View File

@ -2,7 +2,6 @@ from __future__ import print_function
import re, time, threading, socket, SocketServer
from binascii import hexlify, unhexlify
from nacl.secret import SecretBox
from .. import const
from ..util import ipaddrs
from ..util.hkdf import HKDF
@ -270,8 +269,8 @@ class RecordPipe:
self.skt.close()
class Common:
def __init__(self, transit_relay=None):
self._transit_relay = transit_relay or const.TRANSIT_RELAY
def __init__(self, transit_relay):
self._transit_relay = transit_relay
self.winning = threading.Event()
self._negotiation_check_lock = threading.Lock()
self._have_transit_key = threading.Condition()

View File

@ -8,7 +8,7 @@ APPID = "lothar.com/wormhole/file-xfer"
def receive_file(args):
# we're receiving
transit_receiver = TransitReceiver(transit_relay=args.transit_helper)
transit_receiver = TransitReceiver(args.transit_helper)
r = Receiver(APPID, args.relay_url)
code = args.code

View File

@ -10,7 +10,7 @@ def send_file(args):
# we're sending
filename = args.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)
code = i.get_code(args.code_length)