Commit Graph
40 Commits
Author SHA1 Message Date
David Fifield 813a8564e8 Move some helper functions into dns.go. 2020-04-19 11:29:50 -06:00
David Fifield e9a98c3aef Avoid logging EOF and ErrClosedPipe errors.
smux Stream.WriteTo may return io.EOF, which breaks the contract of
io.Copy that says it should not return io.EOF. smux.Stream doesn't have
a unidirectional shutdown, so we always end up slamming it shut in both
directions and leave the other direction with a broken pipe.
2020-04-19 02:13:48 -06:00
David Fifield e7098959e2 Move global base32Encoding into dns.go. 2020-04-18 23:39:35 -06:00
David Fifield b7c18be90f Lowercase base32-encoded data in DNS names. 2020-04-18 23:39:35 -06:00
David Fifield 41c146355a Do MTU check first. 2020-04-18 19:05:23 -06:00
David Fifield 0a630f91c5 Log stream begin/end in server, log conv in client. 2020-04-18 19:05:23 -06:00
David Fifield 7ed79218eb Insert more padding when polling. 2020-04-18 18:46:54 -06:00
David Fifield b1bf9164a7 -privkey-file and -pubkey-file options. 2020-04-18 17:56:45 -06:00
David Fifield 505db3ec23 Server -privkey option and client -pubkey option. 2020-04-18 17:35:32 -06:00
David Fifield b98eb2c75e Move dummyAddr to turbotunnel.DummyAddr. 2020-04-18 16:02:14 -06:00
David Fifield 82ee14fefa Emit a log line even if we take no action on an unknown status code. 2020-04-18 16:02:14 -06:00
David Fifield b0f99e72bb Handle other unknown response status codes the same as 429. 2020-04-18 16:02:14 -06:00
David Fifield e501935578 Handle 429 Too Many Requests. 2020-04-18 16:02:14 -06:00
David Fifield 973f6310c5 Don't expire ClientMap if timeout is zero. 2020-04-18 16:02:14 -06:00
David Fifield 317c2c43d0 Don't send User-Agent.
HTTP header now looks like
```
POST / HTTP/1.1
Host: 127.0.0.1:8000
Content-Length: 221
Accept: application/dns-message
Content-Type: application/dns-message
Accept-Encoding: gzip
```
2020-04-18 16:02:14 -06:00
David Fifield 087d3b25dd Refactor HTTP response handling. 2020-04-18 16:02:14 -06:00
David Fifield e772e7bf2f Add a timeout to HTTP requests and follow redirects. 2020-04-18 16:02:14 -06:00
David Fifield 5350ea1e68 Increase initPollDelay to 500 ms. 2020-04-18 16:02:14 -06:00
David Fifield 7cbddf5fd9 Rework polling.
Give priority to data-carrying packets over polling packets.
Discard a polling packet whenever sending a data-carrying packet.
2020-04-18 16:02:14 -06:00
David Fifield 06144f76ae -dot mode. 2020-04-18 16:02:11 -06:00
David Fifield 1907daeba0 Simplify HTTPPacketConn. 2020-04-18 14:34:10 -06:00
David Fifield be9c3f1ac7 Refactor PacketConn handling. 2020-04-18 14:34:10 -06:00
David Fifield 7f3e9e4571 Overlay a noise layer atop KCP. 2020-04-18 14:34:10 -06:00
David Fifield 3f98c62207 Log when there's an error opening a stream. 2020-04-18 14:34:10 -06:00
David Fifield a6c891c5ae -doh mode. 2020-04-18 14:33:39 -06:00
David Fifield aefe4f9971 Factor out a pattern for different kinds of remote address. 2020-04-18 14:33:39 -06:00
David Fifield 45c44e1c33 Factor out udp.go. 2020-04-18 14:33:39 -06:00
David Fifield 2cf79b1763 Log stream begin/end. 2020-04-18 14:33:39 -06:00
David Fifield 700291d6a1 MTU to log, not stdout. 2020-04-18 14:33:39 -06:00
David Fifield ea824f3658 Check for error from SetMtu. 2020-04-18 14:33:39 -06:00
David Fifield 584dc3950d Advertise EDNS(0) in client. 2020-04-18 14:33:39 -06:00
David Fifield 410dafa29c Packetization server→client direction. 2020-04-18 14:29:30 -06:00
David Fifield ffcea8b633 Logging in client. 2020-04-18 14:29:30 -06:00
David Fifield 0ebbe21789 Don't explicitly send 0-length packets. 2020-04-18 14:29:30 -06:00
David Fifield 933f17de78 Packetization and padding in the client→server direction. 2020-04-18 14:29:29 -06:00
David Fifield bf609a4cf8 Set MTU based on domain length. 2020-04-18 14:29:13 -06:00
David Fifield f47fa9781b Increasing poll interval. 2020-04-18 14:28:55 -06:00
David Fifield 1a630ef92f Automatic polling. 2020-04-18 14:28:55 -06:00
David Fifield 3b48d1aee1 Send full 8-byte ClientID
Sending just 4 bytes and relying on the convid for the remaining bytes
doesn't work for empty polling requests. Could probably just eliminate
the convid and make it a static constant before feeding to KCP.
2020-04-18 14:28:55 -06:00
David Fifield 9f72a8a87d client 2020-04-18 14:28:53 -06:00