Brian Warner
b088747ae3
rename to ServerEndpointService, for consistency with Twisted
2015-09-28 16:23:00 -07:00
Brian Warner
540fceb795
add py3.4 compatibility
...
The "bytes % bytes" syntax only appeared on py3.5, so don't use it.
Updated travis to expect py3.4 works.
The twisted side is probably even more broken for py3.4 than it is for
py3.5.
2015-09-28 16:15:55 -07:00
Brian Warner
6614783c43
make relay work under py3
...
Current twisted.web wants bytes in most places (this will probably
change when twisted.web is properly ported to py3).
2015-09-28 00:24:00 -07:00
Brian Warner
e8626fcea2
relay: deliver EventSource as utf-8
...
This allows the client (requests.py) to produce unicode fields and
lines, instead of binary, which is necessary for py3 compatibility.
2015-09-27 14:35:10 -07:00
Brian Warner
2b37c62150
server: add -n/--no-daemon, to run on py3
...
The twisted.python.logfile in Twisted-15.4.0 is not yet compatible with
py3, but can be bypassed by not daemonizing the server (so it doesn't
write to a logfile). This has been fixed in twisted trunk, so when
15.4.1 or 15.5.0 comes out, this will no longer be needed. But I think
we'll leave it in place, since sometimes it's handy to run a server
without daemonization.
2015-09-27 14:24:03 -07:00
Brian Warner
be124e686a
relay: avoid using Twisted strports
...
strports aren't ported to py3 yet, so we stick with Endpoints and
Services, which have been.
2015-09-26 18:15:35 -07:00
Brian Warner
4c4b5d081b
RelayServer: use in-memory DB for tests
...
This avoids problems where a leftover DB from one run causes "wrong
code" errors in the next.
2015-09-26 17:44:20 -07:00
Brian Warner
894da44244
relay: make it possible to omit the Transit server
2015-06-21 21:08:21 -07:00
Brian Warner
d7415b7053
minor expiration cleanups
2015-05-04 18:28:54 -07:00
Brian Warner
183303e11e
rework expiration, prune after 3 days, check every 2 hours
2015-05-04 18:28:04 -07:00
Brian Warner
dc3f2eee43
server: build ChannelList from db, not self.channels
2015-05-04 18:25:52 -07:00
Brian Warner
1aab908091
allocate_channel_id: use DB to get list of previous allocations
2015-05-04 18:24:23 -07:00
Brian Warner
a03fb3900e
relay: track allocations through DB
2015-05-04 18:24:23 -07:00
Brian Warner
043392ee2a
relay: add database, not used yet
2015-05-04 18:24:23 -07:00
Brian Warner
c3b048a4d3
relay: remove/disable unused code, hush pyflakes
2015-04-20 18:34:45 -07:00
Brian Warner
c393e09e8a
server: add --advertise-version option
2015-04-20 18:34:13 -07:00
Brian Warner
790ae9a0dc
change channel-allocation web API (incompatibly)
...
This will make it easier to manage channel allocation later, when we
switch to a database.
2015-04-10 22:03:08 -05:00
Brian Warner
3aa7e22708
relay: don't require allocate(): first message creates the Channel
...
this enables pre-generated (human-offline-created) codes, as long as
they use a channel id high enough to avoid colliding with any allocated
ones.
2015-04-09 22:46:18 -05:00
Brian Warner
c8d2fc8750
relay: improve the way we allocate channels
...
Now the server allocates a channel randomly from set of available ids
with the shortest possible length. So concurrency=1 will always yield a
channel-id between 1 and 9 (inclusive). If we have 9 simultaneous
sessions, we'll start allocating channels from 10 to 99. 100
simultaneous connections kicks us into the 100-999 bucket, etc.
2015-04-09 22:45:04 -05:00
Brian Warner
ecc04ff675
display message-of-the-day, if the server offers one
2015-04-09 12:45:12 -07:00
Brian Warner
e881d169a6
error out if server gives a "sorry we're closed" error
2015-04-09 12:29:26 -07:00
Brian Warner
782214813b
server+client: fix SSE alternate-event-type handling
...
I think the server needs to put blank lines after *every* field, not
just the data: fields.
2015-04-09 11:37:50 -07:00
Brian Warner
9d7cd1d7de
server: add "welcome message" to all responses, including server version
2015-04-08 21:03:27 -07:00
Brian Warner
dc9bc0c575
Use "wormhole server start" to launch a relay server.
2015-04-08 18:39:33 -07:00
Brian Warner
0217a13da6
change relay URL: use more distinctive path prefix
...
This might make it easier for an application's web site to include a
relay, without competing with some other resource named "relay".
2015-03-25 16:51:55 -07:00
Brian Warner
717bfa3b0b
move public relays to new hostnames and ports
2015-03-25 14:46:35 -07:00
Brian Warner
fd3e4f3508
change relay URL scheme, allow arbitrary relay-phase messages
2015-03-22 11:45:16 -07:00
Brian Warner
315d7c5614
make rendezvous happen in real-time: replace polling with EventSource
2015-03-12 23:07:47 -07:00
Brian Warner
8741d5adaa
relay: refactor in anticipation of a realtime EventSource-based protocol
2015-03-12 19:44:31 -07:00
Brian Warner
cda5634b1d
relay.py: minor refactoring in anticipation of multi-pass rendezvous
2015-03-12 19:22:34 -07:00
Brian Warner
8b3e5836ee
relay: log total bytes sent in each direction
2015-03-12 16:25:34 -07:00
Brian Warner
c9e0246266
relay: reset channel-id to 1 when all channels are idle
2015-03-02 22:04:58 -08:00
Brian Warner
9a11f355ea
relay: expire any rendezvous channel after one hour
2015-03-02 21:22:56 -08:00
Brian Warner
5682ddff8e
fix transit relay
...
stop using web setup for now
2015-03-02 00:09:17 -08:00
Brian Warner
e3964cd797
rearrange source tree
2015-02-15 09:29:28 -08:00