9seconds
437dacfaab
Refactor socksopts per functionality, not per build flag
2026-04-07 15:42:22 +02:00
9seconds
0de8b28de8
Add TCP_NOTSENT_LOWAT setting
2026-04-07 15:39:26 +02:00
9seconds
b58ac669d5
Add TCP_USER_TIMEOUT support
2026-04-07 15:35:47 +02:00
Sergei Arkhipov and GitHub
60ab083def
Merge pull request #452 from 9seconds/tcp-bbr
...
Use TCP BBR in a best-effort mode
2026-04-07 15:33:27 +02:00
9seconds
88f33debab
Use TCP BBR in a best-effort mode
...
This small commits conditionally sets TCP BBR as a preferrable algorithm
for TCP congestion control
2026-04-07 14:54:56 +02:00
9seconds
102f8a6cce
Propagate keep alive settings from the config
2026-04-07 13:41:44 +02:00
appolimp
5f81ae3743
Improve TCP keepalive and idle timeout for mobile clients
...
TCP keepalive was configured (SetKeepAlivePeriod) but never actually
enabled (SO_KEEPALIVE) on accepted client connections. Go 1.26's
SetKeepAlivePeriod only sets TCP_KEEPIDLE — it does not call
setsockopt(SO_KEEPALIVE, 1). Without SO_KEEPALIVE the kernel never
sends probe packets, so dead connections from sleeping mobile clients
linger until the idle timeout fires.
Replace SetKeepAlive + SetKeepAlivePeriod with net.KeepAliveConfig
(available since Go 1.24) for explicit per-socket control:
Idle: 30s (time before first probe)
Interval: 10s (between probes)
Count: 3 (failed probes to declare dead)
This detects dead connections in ~60s instead of relying on system
defaults (tcp_keepalive_intvl=75s, probes=9 → up to 11 minutes).
Increase the default idle timeout from 1 minute to 5 minutes.
MTProto clients send ping_delay_disconnect every ~60s, which resets
the idle timer. The previous 1-minute default created a race: if a
ping arrived even 1–2 seconds late the relay was killed. A 5-minute
window also survives typical mobile sleep periods (phone idle 2–5 min)
where the NAT mapping is still alive and the connection can resume
without reconnection.
Ref: #132
2026-04-04 12:01:33 +03:00
saleacy and GitHub
3bc1e415f9
fix: ensure network.Dial and MakeHTTPClient use socks5 proxy
...
The package `network/v2/proxy_network.go` does not wrap `network.Dial`
and `network.MakeHTTPClient`, which causes them to bypass the SOCKS5
proxy and initiate TCP connections directly from the local machine.
2026-03-17 01:35:18 +08:00
9seconds
a85348d6be
Use curl as user agent
2026-03-12 21:43:04 +01:00
9seconds
62cba24071
Use native dialer to communicate with fronting domain
2026-03-12 20:51:02 +01:00
9seconds
94e4179fb7
Add NativeDialer method to mtglib.Network
2026-03-12 19:25:53 +01:00
9seconds
897e6bf505
Propagate DNS setting to configuration
2026-02-27 16:23:24 +01:00
9seconds
317d7380cb
Add support for custom DNS resolvers
2026-02-27 16:08:28 +01:00
9seconds
1151291535
Use network v2 instead of network v1
2026-02-27 15:52:29 +01:00
9seconds
42927c8bdc
Add v2 network package
2026-02-27 15:50:21 +01:00
9seconds
0440ccf4ff
Rewrite to WaitGroup.Go
2026-02-18 10:34:31 +01:00
9seconds
a0aabf2391
Switch to rand/v2
2026-02-18 10:34:31 +01:00
9seconds
3b03c4a90a
More idioms related to go 1.26
2026-02-17 23:38:12 +01:00
9seconds
36546cec2f
Change default DOH to cloudflarte
2026-02-16 17:18:31 +01:00
9seconds
ecba88d2e3
Update to the latest golangci-lint
2026-02-11 10:20:04 +01:00
9seconds
36dad5a2f6
Update golangci-lint
2022-08-08 15:54:38 +03:00
9seconds
6a19ded78e
Update docs
2022-08-04 18:39:00 +03:00
9seconds
e0850869ba
Linting
2022-03-18 14:58:08 +03:00
9seconds
5282ca26f3
Update golangci-lint to 1.44.2
2022-03-11 17:08:33 +03:00
9seconds
bc3b517e8b
Remove redundant setting of TCP keepalive since it is default
2021-12-02 05:47:45 +03:00
Sergey Arkhipov and GitHub
3f8f96b91f
Merge pull request #230 from 9seconds/simplify-sockopts
...
Simplify sockopts
2021-12-01 16:03:52 +04:00
9seconds
ffad717829
Use CloseRead and CloseWrites
2021-12-01 10:37:31 +03:00
9seconds
66f4d967e7
Get rid of buffersize everywhere
2021-11-28 18:08:40 +03:00
9seconds
d19cfb1df4
Deprecate bufferSize
2021-11-28 17:58:14 +03:00
Sergey Arkhipov and GitHub
853395106b
Merge pull request #223 from boypt/fixdohv6
...
fix ipv6 doh-ip
2021-11-02 18:17:42 +03:00
Bot Git and boypt
d1b0d1f133
fix ipv6 doh-ip
2021-11-02 20:56:58 +08:00
9seconds
d1e5f9d145
Fix windows build
2021-10-04 09:46:49 +03:00
9seconds
686f177ab9
Correct error for non-getting of underlying connection
2021-10-04 09:34:10 +03:00
9seconds
456ed5b051
Change algorithm of TCP relaying
2021-08-27 17:22:36 +03:00
9seconds
eaa757b6d0
Update code to the latest golangci-lint
2021-07-31 11:35:05 +03:00
9seconds
e1864377c2
Update golangci-lint to 1.40.1
2021-05-17 15:26:16 +03:00
9seconds
585ebfeb50
Update golanci-lint
2021-04-09 14:35:04 +03:00
9seconds
372c703ad6
Add documentation for network
2021-04-05 18:46:15 +03:00
9seconds
24fdec6694
Move testlib to internal
2021-04-02 21:32:06 +03:00
9seconds
155a97c25d
Add test for network
2021-04-02 10:34:30 +03:00
9seconds
87a720dd58
Do not use ristretto
...
Memory usage is too big
2021-03-30 16:34:16 +03:00
9seconds
10b78322a3
Implement caching dns resolver
2021-03-30 14:14:37 +03:00
9seconds
7108fe99ec
Add implementation of telegram dialer
2021-03-22 12:30:23 +03:00
9seconds
657a74a5c2
Add defaults for proxy opts
2021-03-18 11:16:08 +03:00
9seconds
f21ee40baf
Remove idle timeout from network
2021-03-17 22:08:47 +03:00
9seconds
adf4ab1a35
Revert "Add new TCPBufferSize parameter to network"
...
This reverts commit 57cb1b5aa0 .
2021-03-17 22:03:36 +03:00
9seconds
57cb1b5aa0
Add new TCPBufferSize parameter to network
2021-03-17 21:44:42 +03:00
9seconds
f52b3391d1
Add firehol blocklist
2021-03-15 16:21:07 +03:00
9seconds
f8ad90c845
Refactor network to a top-level module
2021-03-14 21:43:30 +03:00