Shelikhoo
6ec0025e93
Add broker and server side rejection based on proxy version
2025-02-19 15:47:36 +00:00
Shelikhoo
1bc310c2e9
remove PacketPaddingContainer abstraction
2025-02-13 14:01:04 +00:00
Shelikhoo
94eddc6391
refactor message boundary constrains: coding style
2025-01-30 13:37:22 +00:00
Shelikhoo
1ba58c864d
refactor message boundary constrains
2025-01-30 13:35:36 +00:00
Shelikhoo
0aa1470e01
add connection padding on server side
2025-01-29 11:46:33 +00:00
Shelikhoo
00da3c95ed
use protocol field encoder
2025-01-21 20:55:26 +04:00
David Fifield
2e4139ea97
Remove turbotunnelMode.
...
Replace it with turboTunnelUDPLikeMode, copying comments etc. to make
the changes easier to see.
2025-01-21 20:55:26 +04:00
David Fifield
490502691d
Remove WebRTCPeer.activeTransportMode.
...
Make "u" mode the assumed default. The WebRTC data channel protocol
contains just the hex clientID.
2025-01-21 20:55:25 +04:00
Shelikhoo
ecfd0f3f76
delete expired connection wrapper
2025-01-21 20:55:25 +04:00
Shelikhoo
15189aa5ac
fix checking number of arg before accessing it
2025-01-21 20:55:25 +04:00
Shelikhoo
c7ccaa38f9
add server side support for extra data based client id
2025-01-21 20:55:25 +04:00
Shelikhoo
ad5edd3f01
add kcp setting adjustment SNOWFLAKE_TEST_KCP_FAST3MODE
2025-01-21 20:55:25 +04:00
Shelikhoo
457c4fbf15
Add UDP Like transport mode to snowflake
2025-01-21 20:55:25 +04:00
David Fifield
bb2126b7c6
Use %w, not %v, in fmt.Errorf, so errors can be unwrapped.
...
https://go.dev/blog/go1.13-errors#wrapping-errors-with-w
2024-08-21 17:00:18 -04:00
meskio
6d2011ded7
Report a different implementation for client and server
2024-08-07 12:33:37 +02:00
David Fifield
f25b293fb5
Comment typo.
2024-08-02 03:36:37 +00:00
David Fifield
ee5f815f60
Cosmetic changes from dev-snowflake-udp-rebase-extradata.
...
https://gitlab.torproject.org/shelikhoo/snowflake/-/tree/dev-snowflake-udp-rebase-extradata
commit 59b76dc68d2ee0383c2acd91cb0f44edc46af939
2024-08-01 22:12:56 +00:00
meskio
9e977fe6ca
Report the version of snowflake to the Tor process
2024-07-11 13:39:56 +02:00
meskio
a9df5dd71a
Use ptutil for safelog and prometheus rounded metrics
...
* Related: #40354
2024-05-09 16:24:33 +02:00
David Fifield
1bde730b39
Comment typo.
2024-03-22 00:43:58 +00:00
am3o
acce1f1fd9
refactor: change deprecated "io/ioutil" package to recommended "io" package
2024-02-17 12:47:22 +01:00
David Fifield
d0529141ac
Cosmetic fixes taken from !219 .
...
shelikhoo/dev-udp-performance-rebased branch
https://gitlab.torproject.org/shelikhoo/snowflake/-/commits/9dce28cfc2093490473432ffecd9abaab7ebdbdb
2024-01-16 18:43:58 +00:00
David Fifield
d99f31d881
Have encapsulation.ReadData return an error when the buffer is short.
...
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/merge_requests/154#note_2919109
Still ignoring the io.ErrShortBuffer at the callers, which retains
current behavior.
2023-11-07 05:51:35 +00:00
David Fifield
001f691b47
Have encapsulation.ReadData read into a provided buffer.
...
Instead of unconditionally allocating its own.
2023-11-07 05:51:35 +00:00
David Fifield
9edaee6547
Use IP_BIND_ADDRESS_NO_PORT when dialing the ORPort on Linux.
...
When the orport-srcaddr option is set, we bind to a source IP address
before dialing the ORPort/ExtORPort. tor similarly binds to a source IP
address when OutboundBindAddress is set in torrc. Since tor 0.4.7.13,
tor sets IP_BIND_ADDRESS_NO_PORT, and because problems arise when some
programs use IP_BIND_ADDRESS_NO_PORT and some do not, we also have to
start using IP_BIND_ADDRESS_NO_PORT when we upgrade tor
(tpo/anti-censorship/pluggable-transports/snowflake#40270).
Related: tpo/anti-censorship/pluggable-transports/snowflake#40198
2023-06-08 13:24:22 -06:00
meskio
82cc0f38f7
Move the development to gitlab
...
Related: tpo/anti-censorship/team#86
2023-05-31 10:01:47 +02:00
meskio
f723cf52e8
Merge remote-tracking branch 'gitlab/main'
2023-04-20 16:37:52 +02:00
meskio
297ca91b1d
Use goptlib from gitlab.torproject.org
2023-04-19 17:15:35 +02:00
David Fifield
c097d5f3bc
Use a sync.Pool to reuse packet buffers in QueuePacketConn.
...
This is meant to reduce overall allocations. See past discussion at
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/40260#note_2885524 ff.
2023-04-04 20:22:32 -06:00
David Fifield
6bdd48c006
Restore ListenAndServe error return in Transport.Listen.
...
This error return was lost in 11f0846264
;
i.e. !31 .
Fixes #40043 .
2023-04-03 00:18:26 -06:00
David Fifield
17829d80d5
Comment typo.
2023-03-29 09:49:24 -06:00
David Fifield
936a1f8138
Add a num-turbotunnel server transport option.
...
Replaces the hardcoded numKCPInstances.
2022-12-14 23:02:26 -07:00
David Fifield
c6fabb212d
Use multiple parallel KCP state machines in the server.
...
To distribute CPU load.
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/40200
2022-12-14 23:02:26 -07:00
itchyonion
53e381e45d
Fix server flag name
2022-12-13 09:23:34 -08:00
David Fifield
77b186ae6e
Have SnowflakeClientConn implement io.WriterTo.
...
By forwarding the method to the inner smux.Stream. This is to prevent
io.Copy in the top-level proxy function from allocating a buffer per
client.
The smux.Stream WriteTo method returns io.EOF on success, contrary to
the contract of io.Copy that says it should return nil. Ignore io.EOF in
the proxy loop to avoid a log message.
/anti-censorship/pluggable-transports/snowflake/-/issues/40177
2022-12-08 08:03:54 -07:00
David Fifield
8e5af50bdb
Increase clientIDAddrMapCapacity to 98304.
...
Recent increases in usage have exhausted the capacity of the map.
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/40173
2022-12-03 13:39:56 -07:00
Shelikhoo
4ebd85e5d1
add version output to log
2022-11-23 12:29:55 +00:00
Shelikhoo
33248f3dec
Add Version Output Support to Snowflake
...
From now on, there will be a file at common/version/version.go that includes current version number.
2022-11-23 12:29:51 +00:00
David Fifield
0780f2e809
Add a orport-srcaddr
server transport option.
...
The option controls what source address to use when dialing the
(Ext)ORPort. Using a source address other than 127.0.0.1, or a range of
addresses, can help with localhost ephemeral port exhaustion.
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/40198
2022-11-16 19:41:42 +01:00
David Fifield
2f55581098
Reduce the smux KeepAliveTimeout on the server from 10 to 4 minutes.
...
To save memory, we want to more aggressively close stale connections.
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/40175
2022-11-16 18:48:14 +01:00
trinity-1686a
5ef5142bb0
format using go-1.19
2022-10-09 21:15:50 +02:00
Cecylia Bocovich
bcc162898a
Initialize SnowflakeListener.closed
...
Fixes a bug where an uninitialized channel causes a panic when closed
(#40099 ).
2022-02-08 13:00:43 -05:00
Cecylia Bocovich
c0b35076c9
Remove support for oneshot mode
...
Due to a bug (#40098 ), legacy oneshot connections have not worked for
awhile. Connections without the turbotunnel token would cause the server
to crash. This fixes that bug by removing support altogether and simply
closes the connection.
2022-02-07 11:39:23 -05:00
Shelikhoo
d2f6ea5417
increase clientIDAddrMapCapacity
...
See also:
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/40084
2022-01-18 14:33:34 -05:00
Shelikhoo
50646698e3
Suppress connection end log output
...
This is an amendment of https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/merge_requests/30
2022-01-18 14:33:27 -05:00
Cecylia Bocovich
ead5a960d7
Bump snowflake library imports and go.mod to v2
2021-11-11 10:14:49 -05:00
Cecylia Bocovich
04ba50a531
Change package name and add a package comment
2021-10-07 11:01:33 -04:00
Cecylia Bocovich
4623c7d3e1
Add documentation where necessary for exported items
2021-10-07 11:01:33 -04:00
Cecylia Bocovich
5339ed2dd7
Stop exporting internal code
2021-10-07 11:01:33 -04:00
Cecylia Bocovich
e6715cb4ee
Increase smux and QueuePacketConn buffer sizes
...
This should increase the maximum amount of inflight data and hopefully
the performance of Snowflake, especially for clients geographically
distant from proxies and the server.
2021-08-10 15:38:11 -04:00