Compare commits

..
352 Commits
Author SHA1 Message Date
世界 a72e18bac2 Bump version 2022-09-09 14:43:42 +08:00
世界 138756d638 Fix match 4in6 address in ip_cidr 2022-09-09 14:07:02 +08:00
世界 64db6e9d64 Fix documentation 2022-09-09 13:54:02 +08:00
世界 1ccc37694b Minor fixes 2022-09-08 18:33:59 +08:00
GyDiandGitHub 956445435e Fix clashapi log level format error 2022-09-08 18:04:06 +08:00
世界 e53e408fa8 Update documentation 2022-09-07 23:10:36 +08:00
世界 d77c26ed0d Fix hysteria stream error 2022-09-07 19:16:20 +08:00
世界 78519abb66 Refine test 2022-09-07 19:16:20 +08:00
世界 888dd95d44 Fix processing vmess termination signal 2022-09-07 19:16:20 +08:00
世界 d3d4a6e88f Fix json format error message 2022-09-07 13:23:26 +08:00
世界 2b064ee395 Fix naive inbound temporary 2022-09-07 12:30:54 +08:00
zakuwakiand世界 4f772b014e Suppress accept proxyproto failed #65 2022-09-06 23:16:31 +08:00
世界 db43deed77 Fix wireguard reconnect 2022-09-06 00:11:43 +08:00
世界 956c70c65e Update documentation 2022-09-04 13:15:10 +08:00
世界 90407bab12 Fix DNS routing 2022-09-04 12:49:38 +08:00
世界 fa9450da1e Fix write trojan udp 2022-09-03 16:58:55 +08:00
世界 baa3c2f735 Update documentation for dial fields 2022-09-03 13:02:41 +08:00
世界 273652ae23 Merge dialer options 2022-09-03 12:55:10 +08:00
世界 e290aaaf5c Fix dial parallel in direct outbound 2022-09-03 12:01:48 +08:00
世界 dd1f222840 Fix write zero 2022-09-03 09:25:30 +08:00
void aire()and世界 c22d4a85c0 Fix documentation typo (#60) 2022-09-02 19:04:03 +08:00
世界 65df98a60d Add ws compatibility test 2022-09-01 20:32:47 +08:00
世界 77bb8c2ae8 Fix server install script 2022-09-01 20:32:47 +08:00
世界 0c331b5fea Add with_wireguard to default server tag 2022-09-01 20:16:20 +08:00
世界 97de31e957 Move unstable branch to dev-next 2022-08-31 23:45:42 +08:00
0x7d274284andGitHub 9bc37de02c Fix documentation typo (#57) 2022-08-31 23:42:36 +08:00
世界 4f805ce45f Fix install documentation 2022-08-31 23:37:30 +08:00
世界 abbff39758 Fix write log timestamp 2022-08-31 23:35:43 +08:00
世界 457f13639a Update documentation 2022-08-31 14:34:32 +08:00
世界andGitHub 73746383cc Add shadowtls (#49)
* Add shadowtls outbound

* Add shadowtls inbound

* Add shadowtls example

* Add shadowtls documentation
2022-08-31 14:21:53 +08:00
dyhkwongandGitHub 917c4f0e91 darwin pf support (#52) 2022-08-31 14:21:37 +08:00
世界 5fe5646b6f Refactor outbound documentation 2022-08-31 13:42:30 +08:00
世界 cb523dd454 Fix process_name rule item 2022-08-31 12:51:38 +08:00
世界 ced67719a9 Refactor inbound documetation 2022-08-31 12:50:26 +08:00
世界 421b3ba7a6 Fix smux session status 2022-08-31 10:00:15 +08:00
dyhkwongandGitHub 664c6b68b6 Add process_path rule item (#51)
* process matching supports full path
* Remove strings.ToLower
2022-08-30 10:44:40 +08:00
世界 38a69dac07 Fix socksaddr type condition 2022-08-29 19:58:58 +08:00
世界 56119da3e0 Add chained inbound support 2022-08-29 19:50:28 +08:00
世界 1c6d039e3f Fix inject conn 2022-08-29 19:02:41 +08:00
0x7d274284andGitHub 06cd8f8117 Fix issue template (#48)
The correct command to get the version is `sing-box version`
2022-08-29 16:52:15 +08:00
世界 a008f5f117 Fix search android package in non-owner users 2022-08-29 12:02:29 +08:00
世界 c4a7d8d209 Add grpc compatibility test 2022-08-29 10:15:25 +08:00
世界 4ae78c2db8 Fix log item on document menu 2022-08-28 12:47:23 +08:00
HellojackandGitHub 78a363ba05 Minor fixes (#45)
* Cleanup code
* Fix documentation typo
2022-08-28 12:40:44 +08:00
世界 301512ee4b Update dependencies 2022-08-28 12:21:22 +08:00
世界 7d608c54e6 Add docker image 2022-08-28 00:23:41 +08:00
世界 9dc003c87b Simplify server installation 2022-08-28 00:23:41 +08:00
世界 0e1502ca6c Update documentation 2022-08-28 00:23:41 +08:00
HellojackandGitHub 077969c709 Add gun-lite gRPC implementation (#44) 2022-08-27 21:05:15 +08:00
世界 c169f1b0c7 Fix sniff override destination 2022-08-27 14:37:14 +08:00
rand0mgh0standGitHub efff61021c Fix documentation for socks inbound (#42) 2022-08-27 13:16:04 +08:00
世界 56e0ffeb3a Add vmess packetaddr option 2022-08-27 11:28:01 +08:00
世界 4df3843d86 Add documentation for strict_route 2022-08-27 09:31:17 +08:00
rand0mgh0standGitHub a5d04de985 docs-zh-CN: use English for License section (#40) 2022-08-26 23:21:32 +08:00
世界 731e7fab95 Move documentation branch to main 2022-08-26 21:53:46 +08:00
世界 bfcf1017f0 Add strict_route option 2022-08-26 21:53:08 +08:00
世界 a0d35cf3dc Fix dns hijack on android
iproute2 on android does not support port rules
2022-08-26 21:05:45 +08:00
世界 1e596c25b1 Fix TLS documentation 2022-08-26 18:36:56 +08:00
世界 0bcd2df9c6 Revert linux process searcher 2022-08-26 17:36:06 +08:00
世界 f320a584f6 Initial release 2022-08-26 16:40:37 +08:00
世界 4ea259a94f Fix read DNS message 2022-08-26 13:35:27 +08:00
世界 330826f597 Fix ipv6 route on linux 2022-08-26 12:30:31 +08:00
世界 b0d01c209e Update documentation 2022-08-26 11:10:02 +08:00
世界 8584538e81 Cleanup vmessws 2022-08-26 10:22:29 +08:00
世界 c015310ddb Cleanup vmesshttp 2022-08-26 08:41:45 +08:00
世界 477a730322 Update documentation 2022-08-25 22:49:23 +08:00
世界 b05ead5709 Improve ip_cidr rule 2022-08-25 22:23:26 +08:00
世界 82cd08371a Add contributing documentation 2022-08-25 21:08:29 +08:00
世界 9c7910e75c Fix route connections 2022-08-25 20:48:59 +08:00
世界 273a6b6ad5 Fix ipv6 route on linux 2022-08-25 18:57:36 +08:00
世界 cc353e0d81 Fix http proxy with compressed response 2022-08-25 18:40:13 +08:00
世界 361076a5d5 Fix issue template 2022-08-25 18:40:13 +08:00
世界 8f67ed0750 Fix bind_address 2022-08-25 14:50:10 +08:00
Steven TangandGitHub 9d151eb86a Fix typo in features.md (#32) 2022-08-25 13:42:22 +08:00
zakuwakiand世界 cd29049889 Add trojan fallback for ALPN #31 2022-08-25 13:37:32 +08:00
世界 66e51c5bfb Let vmess use zero instead of auto if TLS enabled 2022-08-25 11:51:17 +08:00
世界 b5d4b267e2 Suppress expected error 2022-08-25 11:02:27 +08:00
世界 9af746ba2f Remove TLS requirement on gRPC server 2022-08-25 10:52:16 +08:00
世界 6b7e9f7949 Close websocket conn gracefully 2022-08-25 10:46:14 +08:00
世界 df073989d2 Add stale workflow 2022-08-25 10:24:11 +08:00
世界 d3e6be3980 Update documentation 2022-08-25 10:04:51 +08:00
ReeceandGitHub c5bee2c2a2 Fix zh-CN document symbol and format (#29) 2022-08-25 09:45:22 +08:00
世界 de944ef795 Initial zh-CN document translation: outbound 2022-08-24 21:02:28 +08:00
世界 a6a3038fd0 Fix early close on windows and catch any 2022-08-24 19:03:15 +08:00
世界 41d9c0d23a Initial zh-CN document translation: inbound 2022-08-24 18:43:39 +08:00
世界 52107ffa56 Initial zh-CN document translation: shared 2022-08-24 17:39:37 +08:00
世界 d0fc15ca54 Add ACME EAB support 2022-08-24 17:06:28 +08:00
世界 7d7acacaf5 Initial zh-CN document translation: route 2022-08-24 16:56:29 +08:00
世界 484f0bb567 Initial zh-CN document translation: DNS 2022-08-24 16:37:06 +08:00
HellojackandGitHub 76f41e5731 Fix TLS insecure (#27) 2022-08-24 16:11:41 +08:00
世界 5732c92943 Fix close non-duplex connections 2022-08-24 14:32:18 +08:00
世界 71c7f4b35d Initial zh-CN document translation: examples 2022-08-24 13:14:12 +08:00
世界 596a34fe2c Initial zh-CN document translation: FAQ 2022-08-24 13:04:47 +08:00
世界 336d9485c4 Initial zh-CN document translation 2022-08-24 12:45:51 +08:00
世界 a1223ce227 Fix unix search path 2022-08-24 12:27:36 +08:00
世界 91cc9534d2 Fix naive padding 2022-08-24 10:21:56 +08:00
世界 1b0f135d7c Update documentation 2022-08-24 00:39:25 +08:00
世界 4eec66d21b Check configuration before reload 2022-08-23 23:44:44 +08:00
世界 a69eddc618 Add proxy protocol support 2022-08-23 21:07:35 +08:00
世界 fe25c4b2dd Handle SIGHUP signal 2022-08-23 19:56:28 +08:00
世界 7288d74b8d Parse X-Forward-For in HTTP requests 2022-08-23 19:53:04 +08:00
世界 b7f61e0993 Fix test naive inbound with nginx 2022-08-23 14:41:31 +08:00
世界 1078439201 Accept HTTP1 in naive inbound 2022-08-23 13:25:03 +08:00
世界 227a6e9921 Add v2ray transport to trojan 2022-08-23 13:24:52 +08:00
世界 fd625f4485 Free memory after start 2022-08-22 23:17:08 +08:00
世界 10a202eb85 Allow http1 in v2ray HTTP transport 2022-08-22 23:02:25 +08:00
世界 46ed01b4c9 Add v2ray HTTP transport 2022-08-22 22:20:19 +08:00
世界 192c360801 Add v2ray QUIC transport 2022-08-22 22:20:19 +08:00
世界 ebc3c54618 Add v2ray WebSocket transport 2022-08-22 22:20:18 +08:00
世界 dbf12fb14d Prepare v2ray client/server transport 2022-08-22 18:57:05 +08:00
世界 fbda05239d Fix clash server early close 2022-08-22 16:33:33 +08:00
世界 68f4a744df Minor fixes 2022-08-22 16:14:53 +08:00
世界 515b350328 Apply bind address to udp connect 2022-08-22 14:35:05 +08:00
世界 6e41cc18f1 Add bind address to outbound options 2022-08-22 14:28:23 +08:00
世界 b6125cb585 Update documentation 2022-08-22 14:19:32 +08:00
世界 045e6d1976 Fix tests 2022-08-22 12:02:16 +08:00
世界 6109040c4c Add strategy setting for each dns server 2022-08-22 12:01:50 +08:00
世界 e18acc7db9 Fix vectorised writer 2022-08-21 22:35:58 +08:00
世界 9ac5648eb8 Add ssh outbound 2022-08-21 22:30:48 +08:00
世界 e883ed3681 Add FAQ page 2022-08-21 22:26:08 +08:00
世界 c2f1cb07af Update release config 2022-08-21 13:03:19 +08:00
世界 f6e163efd7 Fix gvisor udp write back 2022-08-21 11:40:04 +08:00
世界 990a80c2d3 Add tor outbound 2022-08-21 01:06:34 +08:00
世界 0686ad25fd Fix typo in documentation 2022-08-20 21:16:14 +08:00
世界 fb03bb3edd Add trojan connection fallback 2022-08-20 21:08:53 +08:00
世界 53ce452767 Wait a second before check route update 2022-08-20 13:42:28 +08:00
世界 a5f0041cf6 Skip bind connection with private destination to interface 2022-08-20 13:31:15 +08:00
世界 3f41b14d3b Fix write socks5 username password auth request 2022-08-20 13:26:49 +08:00
世界 7909d58f86 Improve process searcher 2022-08-20 12:11:27 +08:00
世界 dcdf6fae31 Fix route on android 2022-08-20 10:27:13 +08:00
世界 a3ce808911 Start outbounds before router 2022-08-20 09:13:00 +08:00
世界 27392068ae Fix read packages in android 13 2022-08-20 03:05:50 +08:00
世界 781952ab3c Attempt to unwrap ip-in-fqdn socksaddr 2022-08-20 00:01:08 +08:00
世界 f3b372a7d0 Update documentation 2022-08-19 22:30:12 +08:00
世界 2cbdc0354f Fix acme issuer 2022-08-19 18:42:12 +08:00
世界 bd88c48b11 Add with_acme to server scripts 2022-08-19 17:48:56 +08:00
世界 467065951c Update gVisor to 20220815.0 2022-08-19 17:47:54 +08:00
世界 cbbdd5bed5 Allow read config from stdin 2022-08-19 15:43:13 +08:00
世界andGitHub 9bfef39b32 Add hysteria and acme TLS certificate issuer (#18)
* Add hysteria client/server
* Add acme TLS certificate issuer
2022-08-19 15:42:57 +08:00
世界 d854a567cc Add back dns concurrent write lock 2022-08-19 10:51:26 +08:00
世界 7fb6788547 Fix darwin tun 2022-08-19 08:35:08 +08:00
世界 6522c0affb Fix log to file 2022-08-19 08:26:26 +08:00
世界 4044d41e0f Fix format 2022-08-19 08:26:26 +08:00
世界 1b261e843c Add write lock to shadowsocks aead writer 2022-08-19 08:26:26 +08:00
世界 d4dcd879ec Fix close shadowsocks server conn 2022-08-18 23:16:05 +08:00
世界 83860510fd Fix find process with lwip stack 2022-08-18 10:10:30 +08:00
Tianling ShenandGitHub e9e002dc67 Fix geosite path (#17)
`geoIPOptions` -> `geositeOptions`

Signed-off-by: Tianling Shen <i@cnsztl.eu.org>
2022-08-18 10:00:56 +08:00
世界 ae1e78b409 Fix lint 2022-08-17 20:15:35 +08:00
世界 e0aaddfe45 Improve async dns transports 2022-08-17 20:10:59 +08:00
世界 dbca1fc507 Update documentation 2022-08-17 15:19:10 +08:00
世界 90328934f3 Add ip_version rule item 2022-08-16 23:47:14 +08:00
世界 1ef9449ca0 Add wireguard outbound and test 2022-08-16 23:39:11 +08:00
世界 0e38106312 Improve tproxy udp write back 2022-08-16 18:37:37 +08:00
世界 26e0c91fe3 Update exec/control usage 2022-08-16 18:19:48 +08:00
世界 29a9b1b84a Fix include_android_user option 2022-08-16 12:16:59 +08:00
世界 32b1fc67f1 Fix copy stream 2022-08-15 16:53:12 +08:00
世界 be04eb3bea Add android package rules support in tun routing 2022-08-15 11:44:59 +08:00
世界 91fd4bacbd Add uid and android user rules support in tun routing 2022-08-15 11:41:00 +08:00
世界 740eb96fa8 Improve cmd 2022-08-13 18:37:51 +08:00
HellojackandGitHub ce02da8698 Fix documentation typo (#13) 2022-08-13 11:01:22 +08:00
世界 f215b21d51 Fix dns concurrent write 2022-08-13 11:00:15 +08:00
世界 c1dad92914 Improve build 2022-08-12 22:58:28 +08:00
世界 86bfe052ac Add UoT option to socks outbound too 2022-08-12 17:55:52 +08:00
世界 0a84f60c32 Improve smux write 2022-08-12 16:49:25 +08:00
HellojackandGitHub 8421a979b4 Add CGO hint in version cmd (#12) 2022-08-12 15:46:26 +08:00
世界 0905d87cc8 Minor fixes 2022-08-12 12:13:57 +08:00
世界 de9fe64751 Update dependencies 2022-08-12 10:58:16 +08:00
世界 cc5440aa67 Refactor bufio 2022-08-11 23:59:22 +08:00
世界 aa0cd04622 Show memory stats in debug 2022-08-11 12:42:17 +08:00
世界 e733bfb803 Enable QUIC in server scripts 2022-08-11 11:45:33 +08:00
世界 1a34319c95 Add back UoT support 2022-08-11 10:36:28 +08:00
ReeceandGitHub 2e675c2808 Fix documentation typo (#10) 2022-08-11 10:06:10 +08:00
世界 0441d2cdd7 Update documentation 2022-08-10 21:21:02 +08:00
世界 312d89980b Add naive inbound and test 2022-08-10 20:36:29 +08:00
iKirbyandGitHub 6d5d74e011 Fix default dns server option (#9) 2022-08-10 12:18:03 +08:00
世界 daca216fe4 Remove incorrect warning 2022-08-09 17:27:22 +08:00
世界 ae40258f87 Update dependencies 2022-08-09 15:55:16 +08:00
世界 266416183e Improve cmd 2022-08-09 14:49:17 +08:00
世界 c0c91cd191 Fix direct connect 2022-08-09 14:48:08 +08:00
世界 25cbcafb90 Improve wintun read 2022-08-08 21:35:59 +08:00
世界 3594fd4593 Update documentation 2022-08-08 21:10:37 +08:00
世界 c95e23d755 Fix copy early conn 2022-08-08 20:56:53 +08:00
世界 769521cafe Add trojan inbound/outbound 2022-08-08 09:08:12 +08:00
世界 6e057a3318 Simplify vmess test 2022-08-08 09:08:12 +08:00
世界 70842ad0ac Fix mux overflow 2022-08-08 08:09:17 +08:00
世界 37771a57e7 Add optional LWIP tun stack support 2022-08-07 17:21:49 +08:00
世界 44732053d0 Update gVisor to 20220801.0 2022-08-07 14:58:07 +08:00
世界 2d6546705a Fix linux unprivileged tun usage 2022-08-07 11:21:10 +08:00
世界 93fb7aa371 Fix wininet wrapper 2022-08-06 17:28:51 +08:00
世界 02832fb136 Add tun support for macOS 2022-08-05 17:02:51 +08:00
世界 ed900a990e Add set system proxy support for macOS 2022-08-05 16:55:59 +08:00
世界 ed32fa60df Add multiplexer for vmess 2022-08-04 10:38:20 +08:00
世界 a6e5654436 Improve multiplex log 2022-08-04 09:12:57 +08:00
世界 ae73634640 Add unsafe tag to multiplexer writer 2022-08-04 00:00:22 +08:00
世界 86442662ea Add documentation for simple linux installation 2022-08-03 22:23:40 +08:00
世界 cc17627a0b Improve multiplexer 2022-08-03 22:01:18 +08:00
世界 b1fa60eabc Improve dns log 2022-08-03 20:17:05 +08:00
世界 07eff298ab Update WriteToUDPAddrPort usage since fixed by go1.18.5 2022-08-03 17:49:04 +08:00
世界 575dce6fb0 Update task usage 2022-08-03 17:44:19 +08:00
世界 5c756f9000 Replace netlink with fork 2022-08-03 12:02:22 +08:00
世界 56e63609c6 Fix windows tun leak memory 2022-08-03 10:14:00 +08:00
世界 cf425de106 Minor fixes 2022-08-02 18:47:23 +08:00
世界 49f4145b23 Improve mux server 2022-08-02 15:11:51 +08:00
世界 4ecb7d2c04 Fix buffer usage 2022-08-02 13:43:25 +08:00
世界 ffec06e730 Fix dns sniff 2022-08-02 13:42:31 +08:00
世界 c7a9272113 Add documentation for vmess 2022-08-01 17:02:13 +08:00
世界 d0c9fdcf66 Add vmess legacy server and test 2022-08-01 12:23:34 +08:00
世界 15c8853f66 Fix netlink subscription leak 2022-07-31 19:58:32 +08:00
世界 9fbaff4b23 Make socks request buffered 2022-07-31 19:58:32 +08:00
世界 2a0499d8fc Close tun endpoint faster 2022-07-31 19:58:32 +08:00
世界 fb16f5a2d6 Add retry for mux stream open 2022-07-31 18:08:24 +08:00
世界 1c50521985 Fix tcp keep alive 2022-07-31 09:53:29 +08:00
世界 770e58a79d Fix dns outbound 2022-07-31 08:48:56 +08:00
世界 d182ec0430 Add omitempty for listen_port 2022-07-30 22:05:06 +08:00
世界 235d9ec12a Add TLS certificate reload 2022-07-30 22:04:01 +08:00
世界 e0eaae9b69 Add documentation for shadowsocks multiplexer 2022-07-30 21:23:45 +08:00
世界 0dedbbf37a Fix copy with src buffer to headroom writer 2022-07-30 21:23:45 +08:00
世界 ee6f271456 Minor fixes 2022-07-30 14:50:33 +08:00
世界 81fc09d190 Improve error processing 2022-07-30 09:57:02 +08:00
世界 336bceeb97 Add linux server scripts 2022-07-30 09:04:01 +08:00
世界 1570c3b6f5 Use connect for quic/dns udp connections 2022-07-30 09:04:01 +08:00
世界 10531c9f9a Add multiplexer 2022-07-30 09:04:01 +08:00
世界 8e8b1b974e Hide dns outbound in clash-dashboard 2022-07-28 16:40:06 +08:00
世界 806ec58d43 Remove urltest outbound 2022-07-28 16:36:31 +08:00
世界 4bd6eee63e Add shadowsocks-multiuser control api 2022-07-27 21:59:40 +08:00
世界 70f48ddc3f Update documentation 2022-07-27 12:13:31 +08:00
世界 f0a53b5cae Add endpoint independent nat support for tun inbound 2022-07-27 11:59:36 +08:00
世界 3a7a4bab12 Remove go-json 2022-07-26 13:53:25 +08:00
世界 0abf9a06c3 Add optional DoT, DoH3 support 2022-07-26 12:48:10 +08:00
世界 46744ec75b Fix clash tracker timeout 2022-07-26 06:56:24 +08:00
世界 832f906700 Improve udp timeout 2022-07-25 22:15:16 +08:00
世界 c3053249fe Print stack if no context 2022-07-25 16:18:22 +08:00
世界 b23a8dd0a5 Fix format command 2022-07-25 16:18:11 +08:00
世界 6bac91c849 Fix direct udp outbound 2022-07-25 16:18:11 +08:00
世界 18bdfbf187 Improve config struct 2022-07-25 16:18:11 +08:00
世界 94ae7403ef Improve tls dialer and listener 2022-07-25 16:18:11 +08:00
世界 3241e5e968 Add runtime warnings 2022-07-25 07:19:15 +08:00
世界 d52456b74e Add retry for linux process search 2022-07-24 21:43:05 +08:00
世界 223f68b7c3 Add default tcp keep alive settings 2022-07-24 21:29:39 +08:00
世界 7fa1f2dcac Improve udp dns close 2022-07-24 21:25:41 +08:00
世界 698da23a10 Add lint workflow 2022-07-24 21:22:19 +08:00
世界 fd8359df77 Add with_std_json build tag 2022-07-24 21:22:19 +08:00
世界 a56f4bda5c Add route.default_mark option 2022-07-24 17:46:25 +08:00
世界 2bea4818b5 Add source_port_range/port_range rule item 2022-07-24 16:21:35 +08:00
世界 68e8c59225 Add disable_cache option to dns rule 2022-07-24 16:21:31 +08:00
世界 6d8e3235ac Add rcode dns transport 2022-07-24 16:21:31 +08:00
世界 d0f1d7f3dc Add invert rule item 2022-07-24 16:21:31 +08:00
世界 fbdf3e4b38 Fix direct inbound 2022-07-24 13:42:58 +08:00
世界 783ff628db Add process_name/package_name/user/user_id rule item 2022-07-23 21:28:13 +08:00
世界 8009f581fe Fix urltest log 2022-07-23 10:28:32 +08:00
世界 5ab60c4004 Update documentations 2022-07-23 09:29:37 +08:00
世界 d53056360b Deprecate dns_hijack and dns inbound 2022-07-23 09:15:47 +08:00
世界 466912ad4a Improve 4in6 processing 2022-07-22 17:57:23 +08:00
世界 c45e229ce2 Fix tproxy inbound 2022-07-22 16:18:56 +08:00
世界 cfe2a0d4f3 Fix log format 2022-07-22 14:28:29 +08:00
世界 2d78fbb314 Fix dns inbound 2022-07-22 14:25:04 +08:00
世界 17ff830fed Add documentation for selector/urltest outbound 2022-07-22 14:07:27 +08:00
世界 1fef7d93f2 Add urltest outbound 2022-07-22 13:51:08 +08:00
世界 1f3cc0ca7d Expand env in clash external-ui 2022-07-22 09:49:35 +08:00
世界 15ee00c24b Fix integration with clash-dashboard 2022-07-22 09:41:12 +08:00
世界 544fca8257 Add selector outbound 2022-07-21 21:13:16 +08:00
世界 2946ee1267 Improve socksaddr 2022-07-20 22:05:11 +08:00
世界 585e3b325c Minor fixes 2022-07-20 13:46:47 +08:00
世界 c7c66c49ed Add documentation for clash_api 2022-07-20 07:37:50 +08:00
世界 98adef316a Make clash api and gVisor optional 2022-07-20 07:12:40 +08:00
世界 5905ad3278 Add basic clash api 2022-07-19 22:45:55 +08:00
世界 eacf611ee9 Improve connection timeout 2022-07-18 20:53:13 +08:00
世界 f7fa342b31 Add vmess compatibility test 2022-07-18 20:14:53 +08:00
世界 4fce3cff24 Add vmess inbound/outbound 2022-07-18 12:32:31 +08:00
世界 02ef795581 Add user rule item 2022-07-17 17:38:11 +08:00
世界 392a9da692 Exclude gVisor for unsupported arch 2022-07-17 11:16:13 +08:00
世界 9debfd4cc6 Disable gVisor log 2022-07-17 11:15:56 +08:00
世界 175f1f2ba7 Improve workflow build 2022-07-17 09:54:34 +08:00
世界 27423768ac Update dependencies 2022-07-17 09:18:36 +08:00
世界 92df9ff065 Add debug build for all arch 2022-07-17 09:11:23 +08:00
世界 7339521397 Fix build 2022-07-17 08:48:57 +08:00
世界 57a9928fdb Minor fixes 2022-07-16 22:03:35 +08:00
世界 cc711a141a Add stun sniffer 2022-07-16 12:01:02 +08:00
世界 acccd2968c Fix private addr check 2022-07-16 10:19:18 +08:00
世界 9908b4ee6c Fix linux tun 2022-07-15 22:40:42 +08:00
世界 6b4eeda413 Fix set_system_proxy when using sudo 2022-07-15 18:30:01 +08:00
世界 daaa089b31 Fix tun auto_route on android 2022-07-15 18:29:29 +08:00
世界 0c5e07b2d2 Add route.default_interface option 2022-07-15 15:00:54 +08:00
世界 12795bc504 Add ss aead tests 2022-07-15 11:18:19 +08:00
世界 00f1faeea5 Add redir tproxy and dns inbound 2022-07-15 08:42:02 +08:00
世界 7686fd0ecb Improve bind interface 2022-07-14 23:11:53 +08:00
世界 a257c481c3 Add set_system_proxy for linux and android 2022-07-14 20:32:17 +08:00
世界 1d9913604c Add documentation for set_system_proxy 2022-07-14 14:41:35 +08:00
世界 1314345f28 Add set_system_proxy option for windows 2022-07-14 14:41:35 +08:00
世界 901a41d350 Add tun inbound for windows 2022-07-13 22:41:21 +08:00
世界 e3b186733e Refactor log 2022-07-12 17:44:12 +08:00
世界 39c6784ba7 Improve copy early conn 2022-07-11 20:55:14 +08:00
世界 a4ad38a0a9 Fix tcp sniffing 2022-07-11 20:37:57 +08:00
世界 3d16df288c Migrate components to library 2022-07-11 18:44:59 +08:00
世界 f548511d7e Make dns.strategy take effect in dns exchange 2022-07-11 13:21:17 +08:00
世界 90450c4d06 Fix hijack_dns 2022-07-11 12:56:57 +08:00
世界 730599470e Remove ToString0[T] usage to fix golangci-lint 2022-07-10 22:00:28 +08:00
世界 725b15175d Fix create gVisor endpoint 2022-07-10 19:17:44 +08:00
世界 3d5bd9eb1f Add documentation and example for linux tun 2022-07-10 16:44:12 +08:00
世界 70901c0946 Minor fixes 2022-07-10 16:19:42 +08:00
世界 ddfae8cd07 Add hijack_dns for tun 2022-07-10 10:14:45 +08:00
世界 a34057753c Add auto_route and auto_detect_interface for linux 2022-07-10 08:18:52 +08:00
世界 08e03345d5 Fix quic sniff irl 2022-07-10 07:52:33 +08:00
世界 6795fe15dd Add tun inbound for linux 2022-07-09 22:44:18 +08:00
世界 cee09c6e9d Fix pages 2022-07-09 15:09:50 +08:00
世界 e518a26dc2 Add benchmark page 2022-07-09 15:00:31 +08:00
世界 4a7739393f Fix direct udp 2022-07-09 10:28:22 +08:00
世界 b1ad598def Add bug template 2022-07-09 09:34:16 +08:00
世界 a41127179d Declare required fields in the documentation 2022-07-09 09:28:54 +08:00
世界 34a99b5509 Add debug workflow 2022-07-09 09:02:06 +08:00
世界 3a298245a9 Add shadowsocks tests 2022-07-09 08:59:34 +08:00
世界 2cc746aafe Update gci format 2022-07-08 23:03:57 +08:00
世界 1053bcaada Fix handle missing err on quic sniff 2022-07-08 22:49:17 +08:00
世界 1b05b56f04 Add examples 2022-07-08 22:45:06 +08:00
世界 4bab84be67 Add route documentation 2022-07-08 20:20:38 +08:00
世界 b383757742 Add outbound documentation 2022-07-08 19:58:56 +08:00
世界 b39a776785 Add inbound documentation 2022-07-08 18:42:29 +08:00
世界 bd914916b3 Add README 2022-07-08 18:41:18 +08:00
世界 493f517d93 Add log and dns documentation 2022-07-08 18:41:18 +08:00
世界 0cc16a7836 Add dial parallel for outbound dialer 2022-07-08 13:08:29 +08:00
世界 f121a6d723 Improve load geosite 2022-07-08 11:00:46 +08:00
世界 b91ed698cd Add resolver for inbound 2022-07-07 23:45:05 +08:00
世界 f65f3f1ba0 Add resolver for outbound dialer 2022-07-07 21:47:21 +08:00
世界 d921797e3c Add disableCache/disableExpire option for dns client 2022-07-06 23:43:20 +08:00
世界 001dc5f62c Add dns client 2022-07-06 23:14:19 +08:00
世界 63e1b53a49 Add dns transports 2022-07-06 19:01:46 +08:00
世界 a3a61c174f Remove lint action 2022-07-06 15:45:13 +08:00
世界 9107a2fe33 Update gci format 2022-07-06 15:01:09 +08:00
世界 070d3c56ed Add protect path dialer option 2022-07-06 14:45:56 +08:00
世界 8867768a7d Rename find path 2022-07-06 14:44:51 +08:00
世界 3e2dddfb16 Add domain sniffer 2022-07-06 12:39:44 +08:00
世界 625bc649ee Refactor geo resources 2022-07-05 13:23:47 +08:00
世界 f9d8fa2b91 Add geosite 2022-07-05 09:05:35 +08:00
世界 86456b9cbc Add geosite protocol 2022-07-04 19:39:58 +08:00
世界 b8e45853c0 Fix route 2022-07-04 19:34:45 +08:00
世界 dfde4e34c0 Add version command 2022-07-04 17:14:15 +08:00
世界 bcf0bb26a7 Add check/format command 2022-07-04 16:59:27 +08:00
世界 c33a079c88 Refine log output 2022-07-04 16:45:32 +08:00
世界 616b599104 Add domain_regex rule 2022-07-04 15:51:41 +08:00
世界 6af52f8bb6 Shadowsocks multi-user/relay inbound 2022-07-04 15:34:43 +08:00
世界 13c069740f Add http/block outbound & Improve route 2022-07-04 08:16:25 +08:00
世界 f510323dca Refactor struct & Add override dialer options 2022-07-03 20:59:25 +08:00
世界 ffedce0f5f Refactor json 2022-07-03 19:43:27 +08:00
世界 5fc6e2c0db Add internal private geoip rule 2022-07-03 15:57:09 +08:00
世界 388b9f06e9 Add socks outbound 2022-07-03 13:14:49 +08:00
世界 d8cff01c4a Ordered json output & Disallow unknown fields 2022-07-03 11:28:15 +08:00
世界 71d9772913 Add format config support 2022-07-03 03:42:57 +08:00
世界 add5896378 Invalid config check 2022-07-03 01:57:04 +08:00
世界 ad01befeee Implement route rules 2022-07-02 23:19:14 +08:00
世界 0e9bd9b091 Inbound rule support 2022-07-02 14:07:50 +08:00
世界 737a61be66 Refactor adapter 2022-07-01 19:37:41 +08:00
世界 cfa35e5a92 Init commit 2022-07-01 16:58:18 +08:00
25 changed files with 67 additions and 159 deletions
-2
View File
@@ -3,7 +3,6 @@ name: Debug build
on:
push:
branches:
- main
- dev
- dev-next
paths-ignore:
@@ -12,7 +11,6 @@ on:
- '!.github/workflows/debug.yml'
pull_request:
branches:
- main
- dev
- dev-next
+1 -1
View File
@@ -1,6 +1,6 @@
package constant
var (
Version = "1.0.3"
Version = "1.0.1"
Commit = ""
)
+1 -1
View File
@@ -8,10 +8,10 @@ import (
"github.com/sagernet/sing-box/common/json"
"github.com/sagernet/sing-box/experimental/clashapi/trafficontrol"
"github.com/sagernet/websocket"
"github.com/go-chi/chi/v5"
"github.com/go-chi/render"
"github.com/gorilla/websocket"
)
func connectionRouter(trafficManager *trafficontrol.Manager) http.Handler {
+1 -1
View File
@@ -21,11 +21,11 @@ import (
E "github.com/sagernet/sing/common/exceptions"
F "github.com/sagernet/sing/common/format"
N "github.com/sagernet/sing/common/network"
"github.com/sagernet/websocket"
"github.com/go-chi/chi/v5"
"github.com/go-chi/cors"
"github.com/go-chi/render"
"github.com/gorilla/websocket"
)
var _ adapter.ClashServer = (*Server)(nil)
+3 -3
View File
@@ -12,6 +12,7 @@ require (
github.com/go-chi/cors v1.2.1
github.com/go-chi/render v1.0.2
github.com/gofrs/uuid v4.2.0+incompatible
github.com/gorilla/websocket v1.5.0
github.com/hashicorp/yamux v0.1.1
github.com/logrusorgru/aurora v2.0.3+incompatible
github.com/mholt/acmez v1.0.4
@@ -19,13 +20,12 @@ require (
github.com/pires/go-proxyproto v0.6.2
github.com/sagernet/certmagic v0.0.0-20220819042630-4a57f8b6853a
github.com/sagernet/quic-go v0.0.0-20220818150011-de611ab3e2bb
github.com/sagernet/sing v0.0.0-20220913004915-27ddefbb8921
github.com/sagernet/sing v0.0.0-20220903085538-02b9ca1cc133
github.com/sagernet/sing-dns v0.0.0-20220822023312-3e086b06d666
github.com/sagernet/sing-shadowsocks v0.0.0-20220819002358-7461bb09a8f6
github.com/sagernet/sing-tun v0.0.0-20220828031750-185b6c880a83
github.com/sagernet/sing-vmess v0.0.0-20220913015714-c4ab86d40e12
github.com/sagernet/sing-vmess v0.0.0-20220907073918-72d7fdf6825f
github.com/sagernet/smux v0.0.0-20220831015742-e0f1988e3195
github.com/sagernet/websocket v0.0.0-20220913015213-615516348b4e
github.com/spf13/cobra v1.5.0
github.com/stretchr/testify v1.8.0
go.uber.org/atomic v1.10.0
+6 -6
View File
@@ -73,6 +73,8 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE=
github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ=
@@ -133,20 +135,18 @@ github.com/sagernet/quic-go v0.0.0-20220818150011-de611ab3e2bb h1:wc0yQ+SBn4TaTY
github.com/sagernet/quic-go v0.0.0-20220818150011-de611ab3e2bb/go.mod h1:MIccjRKnPTjWwAOpl+AUGWOkzyTd9tERytudxu+1ra4=
github.com/sagernet/sing v0.0.0-20220812082120-05f9836bff8f/go.mod h1:QVsS5L/ZA2Q5UhQwLrn0Trw+msNd/NPGEhBKR/ioWiY=
github.com/sagernet/sing v0.0.0-20220817130738-ce854cda8522/go.mod h1:QVsS5L/ZA2Q5UhQwLrn0Trw+msNd/NPGEhBKR/ioWiY=
github.com/sagernet/sing v0.0.0-20220913004915-27ddefbb8921 h1:xUHzlIbdlPV/fkToIO9futp9lmKIY+72ezk/whQ8XsI=
github.com/sagernet/sing v0.0.0-20220913004915-27ddefbb8921/go.mod h1:kZvzh1VDa/Dg/Bt5WaYKU0jl5ept8KKDpl3Ay4gRtRQ=
github.com/sagernet/sing v0.0.0-20220903085538-02b9ca1cc133 h1:krnb8wKEFIdXhmJYlhJMbEcPsJFISy2fz90uHVz7hMU=
github.com/sagernet/sing v0.0.0-20220903085538-02b9ca1cc133/go.mod h1:kZvzh1VDa/Dg/Bt5WaYKU0jl5ept8KKDpl3Ay4gRtRQ=
github.com/sagernet/sing-dns v0.0.0-20220822023312-3e086b06d666 h1:XUTocA/Ek0dFxUX+xJCWMPPFZCn2GC/uLrBjTSr1vHY=
github.com/sagernet/sing-dns v0.0.0-20220822023312-3e086b06d666/go.mod h1:eDyH7AJmqBGjZQdQmpZIzlbTREudZuWDExMuGKgjRVM=
github.com/sagernet/sing-shadowsocks v0.0.0-20220819002358-7461bb09a8f6 h1:JJfDeYYhWunvtxsU/mOVNTmFQmnzGx9dY034qG6G3g4=
github.com/sagernet/sing-shadowsocks v0.0.0-20220819002358-7461bb09a8f6/go.mod h1:EX3RbZvrwAkPI2nuGa78T2iQXmrkT+/VQtskjou42xM=
github.com/sagernet/sing-tun v0.0.0-20220828031750-185b6c880a83 h1:SoWiHYuOCVedqA7T/CJSZUUrcPGKQb2wFKEq8DphiAI=
github.com/sagernet/sing-tun v0.0.0-20220828031750-185b6c880a83/go.mod h1:76r07HS1WRcEI4mE9pFsohfTBUt1j/G9Avz6DaOP3VU=
github.com/sagernet/sing-vmess v0.0.0-20220913015714-c4ab86d40e12 h1:4HYGbTDDemgBVTmaspXbkgjJlXc3hYVjNxSddJndq8Y=
github.com/sagernet/sing-vmess v0.0.0-20220913015714-c4ab86d40e12/go.mod h1:u66Vv7NHXJWfeAmhh7JuJp/cwxmuQlM56QoZ7B7Mmd0=
github.com/sagernet/sing-vmess v0.0.0-20220907073918-72d7fdf6825f h1:6l9aXZqAl1JqXJWi89KHpWnM/moQUPGG+XiwMc+yD0A=
github.com/sagernet/sing-vmess v0.0.0-20220907073918-72d7fdf6825f/go.mod h1:u66Vv7NHXJWfeAmhh7JuJp/cwxmuQlM56QoZ7B7Mmd0=
github.com/sagernet/smux v0.0.0-20220831015742-e0f1988e3195 h1:5VBIbVw9q7aKbrFdT83mjkyvQ+VaRsQ6yflTepfln38=
github.com/sagernet/smux v0.0.0-20220831015742-e0f1988e3195/go.mod h1:yedWtra8nyGJ+SyI+ziwuaGMzBatbB10P1IOOZbbSK8=
github.com/sagernet/websocket v0.0.0-20220913015213-615516348b4e h1:7uw2njHFGE+VpWamge6o56j2RWk4omF6uLKKxMmcWvs=
github.com/sagernet/websocket v0.0.0-20220913015213-615516348b4e/go.mod h1:45TUl8+gH4SIKr4ykREbxKWTxkDlSzFENzctB1dVRRY=
github.com/spf13/cobra v1.5.0 h1:X+jTBEBqF0bHN+9cSMgmfuvv2VHJ9ezmFNf9Y/XstYU=
github.com/spf13/cobra v1.5.0/go.mod h1:dWXEIy2H428czQCjInthrTRUg7yKbok+2Qi/yBIJoUM=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
+2
View File
@@ -3,6 +3,7 @@ package inbound
import (
"context"
"net"
"sync"
"github.com/sagernet/sing-box/adapter"
"github.com/sagernet/sing-box/common/settings"
@@ -41,6 +42,7 @@ type myInboundAdapter struct {
tcpListener net.Listener
udpConn *net.UDPConn
udpAddr M.Socksaddr
packetAccess sync.RWMutex
packetOutboundClosed chan struct{}
packetOutbound chan *myInboundPacket
}
+7 -2
View File
@@ -203,12 +203,17 @@ func (s *myInboundPacketAdapter) Upstream() any {
}
func (s *myInboundPacketAdapter) WritePacket(buffer *buf.Buffer, destination M.Socksaddr) error {
s.packetAccess.RLock()
defer s.packetAccess.RUnlock()
select {
case s.packetOutbound <- &myInboundPacket{buffer, destination}:
return nil
case <-s.packetOutboundClosed:
return os.ErrClosed
default:
}
s.packetOutbound <- &myInboundPacket{buffer, destination}
return nil
}
func (s *myInboundPacketAdapter) Close() error {
+6 -14
View File
@@ -250,6 +250,12 @@ func (h *Hysteria) acceptStream(ctx context.Context, conn quic.Connection, strea
if err != nil {
return err
}
err = hysteria.WriteServerResponse(stream, hysteria.ServerResponse{
OK: true,
})
if err != nil {
return err
}
var metadata adapter.InboundContext
metadata.Inbound = h.tag
metadata.InboundType = C.TypeHysteria
@@ -259,14 +265,7 @@ func (h *Hysteria) acceptStream(ctx context.Context, conn quic.Connection, strea
metadata.Source = M.SocksaddrFromNet(conn.RemoteAddr())
metadata.OriginDestination = M.SocksaddrFromNet(conn.LocalAddr())
metadata.Destination = M.ParseSocksaddrHostPort(request.Host, request.Port)
if !request.UDP {
err = hysteria.WriteServerResponse(stream, hysteria.ServerResponse{
OK: true,
})
if err != nil {
return err
}
h.logger.InfoContext(ctx, "inbound connection to ", metadata.Destination)
return h.router.RouteConnection(ctx, hysteria.NewConn(stream, metadata.Destination), metadata)
} else {
@@ -278,13 +277,6 @@ func (h *Hysteria) acceptStream(ctx context.Context, conn quic.Connection, strea
h.udpSessions[id] = nCh
h.udpSessionId += 1
h.udpAccess.Unlock()
err = hysteria.WriteServerResponse(stream, hysteria.ServerResponse{
OK: true,
UDPSessionID: id,
})
if err != nil {
return err
}
packetConn := hysteria.NewPacketConn(conn, stream, id, metadata.Destination, nCh, common.Closer(func() error {
h.udpAccess.Lock()
if ch, ok := h.udpSessions[id]; ok {
+2 -11
View File
@@ -20,9 +20,8 @@ var _ adapter.Outbound = (*Socks)(nil)
type Socks struct {
myOutboundAdapter
client *socks.Client
resolve bool
uot bool
client *socks.Client
uot bool
}
func NewSocks(router adapter.Router, logger log.ContextLogger, tag string, options option.SocksOutboundOptions) (*Socks, error) {
@@ -46,7 +45,6 @@ func NewSocks(router adapter.Router, logger log.ContextLogger, tag string, optio
tag: tag,
},
socks.NewClient(detour, options.ServerOptions.Build(), version, options.Username, options.Password),
version == socks.Version4,
options.UoT,
}, nil
}
@@ -74,13 +72,6 @@ func (h *Socks) DialContext(ctx context.Context, network string, destination M.S
default:
return nil, E.Extend(N.ErrUnknownNetwork, network)
}
if destination.IsFqdn() {
addrs, err := h.router.LookupDefault(ctx, destination.Fqdn)
if err != nil {
return nil, err
}
return N.DialSerial(ctx, h.client, network, destination, addrs)
}
return h.client.DialContext(ctx, network, destination)
}
-3
View File
@@ -82,9 +82,6 @@ func (r *Router) Lookup(ctx context.Context, domain string, strategy dns.DomainS
r.dnsLogger.InfoContext(ctx, "lookup succeed for ", domain, ": ", strings.Join(F.MapToString(addrs), " "))
} else {
r.dnsLogger.ErrorContext(ctx, E.Cause(err, "lookup failed for ", domain))
if err == nil {
err = dns.RCodeNameError
}
}
return addrs, err
}
+2 -16
View File
@@ -82,20 +82,6 @@ func testSuitSimple(t *testing.T, clientPort uint16, testPort uint16) {
require.NoError(t, testPingPongWithPacketConn(t, testPort, dialUDP))
}
func testSuitSimple1(t *testing.T, clientPort uint16, testPort uint16) {
dialer := socks.NewClient(N.SystemDialer, M.ParseSocksaddrHostPort("127.0.0.1", clientPort), socks.Version5, "", "")
dialTCP := func() (net.Conn, error) {
return dialer.DialContext(context.Background(), "tcp", M.ParseSocksaddrHostPort("127.0.0.1", testPort))
}
dialUDP := func() (net.PacketConn, error) {
return dialer.ListenPacket(context.Background(), M.ParseSocksaddrHostPort("127.0.0.1", testPort))
}
require.NoError(t, testPingPongWithConn(t, testPort, dialTCP))
require.NoError(t, testPingPongWithPacketConn(t, testPort, dialUDP))
require.NoError(t, testPingPongWithConn(t, testPort, dialTCP))
require.NoError(t, testLargeDataWithPacketConn(t, testPort, dialUDP))
}
func testSuitWg(t *testing.T, clientPort uint16, testPort uint16) {
dialer := socks.NewClient(N.SystemDialer, M.ParseSocksaddrHostPort("127.0.0.1", clientPort), socks.Version5, "", "")
dialTCP := func() (net.Conn, error) {
@@ -108,8 +94,8 @@ func testSuitWg(t *testing.T, clientPort uint16, testPort uint16) {
}
return bufio.NewUnbindPacketConn(conn), nil
}
require.NoError(t, testPingPongWithConn(t, testPort, dialTCP))
require.NoError(t, testPingPongWithPacketConn(t, testPort, dialUDP))
require.NoError(t, testLargeDataWithConn(t, testPort, dialTCP))
require.NoError(t, testLargeDataWithPacketConn(t, testPort, dialUDP))
// require.NoError(t, testPingPongWithConn(t, testPort, dialTCP))
// require.NoError(t, testPingPongWithPacketConn(t, testPort, dialUDP))
}
+14 -17
View File
@@ -385,24 +385,21 @@ func testLargeDataWithPacketConn(t *testing.T, port uint16, pcc func() (net.Pack
hashMap := map[int][]byte{}
mux := sync.Mutex{}
for i := 0; i < times; i++ {
go func(idx int) {
buf := make([]byte, chunkSize)
if _, err := rand.Read(buf[1:]); err != nil {
t.Log(err.Error())
return
}
buf[0] = byte(idx)
buf := make([]byte, chunkSize)
if _, err = rand.Read(buf[1:]); err != nil {
t.Log(err.Error())
continue
}
buf[0] = byte(i)
hash := md5.Sum(buf)
mux.Lock()
hashMap[idx] = hash[:]
mux.Unlock()
if _, err := pc.WriteTo(buf, addr); err != nil {
t.Log(err.Error())
return
}
}(i)
hash := md5.Sum(buf)
mux.Lock()
hashMap[i] = hash[:]
mux.Unlock()
if _, err = pc.WriteTo(buf, addr); err != nil {
t.Log(err)
continue
}
}
return hashMap, nil
+3 -3
View File
@@ -10,7 +10,7 @@ require (
github.com/docker/docker v20.10.17+incompatible
github.com/docker/go-connections v0.4.0
github.com/gofrs/uuid v4.2.0+incompatible
github.com/sagernet/sing v0.0.0-20220913004915-27ddefbb8921
github.com/sagernet/sing v0.0.0-20220903085538-02b9ca1cc133
github.com/sagernet/sing-shadowsocks v0.0.0-20220819002358-7461bb09a8f6
github.com/spyzhov/ajson v0.7.1
github.com/stretchr/testify v1.8.0
@@ -37,6 +37,7 @@ require (
github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/btree v1.0.1 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/hashicorp/yamux v0.1.1 // indirect
github.com/klauspost/cpuid/v2 v2.1.0 // indirect
github.com/libdns/libdns v0.2.1 // indirect
@@ -62,9 +63,8 @@ require (
github.com/sagernet/quic-go v0.0.0-20220818150011-de611ab3e2bb // indirect
github.com/sagernet/sing-dns v0.0.0-20220903082137-b1102b8fc961 // indirect
github.com/sagernet/sing-tun v0.0.0-20220828031750-185b6c880a83 // indirect
github.com/sagernet/sing-vmess v0.0.0-20220913015714-c4ab86d40e12 // indirect
github.com/sagernet/sing-vmess v0.0.0-20220907073918-72d7fdf6825f // indirect
github.com/sagernet/smux v0.0.0-20220831015742-e0f1988e3195 // indirect
github.com/sagernet/websocket v0.0.0-20220913015213-615516348b4e // indirect
github.com/sirupsen/logrus v1.8.1 // indirect
github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74 // indirect
go.uber.org/atomic v1.10.0 // indirect
+6 -6
View File
@@ -85,6 +85,8 @@ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE=
github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ=
@@ -153,20 +155,18 @@ github.com/sagernet/quic-go v0.0.0-20220818150011-de611ab3e2bb h1:wc0yQ+SBn4TaTY
github.com/sagernet/quic-go v0.0.0-20220818150011-de611ab3e2bb/go.mod h1:MIccjRKnPTjWwAOpl+AUGWOkzyTd9tERytudxu+1ra4=
github.com/sagernet/sing v0.0.0-20220812082120-05f9836bff8f/go.mod h1:QVsS5L/ZA2Q5UhQwLrn0Trw+msNd/NPGEhBKR/ioWiY=
github.com/sagernet/sing v0.0.0-20220817130738-ce854cda8522/go.mod h1:QVsS5L/ZA2Q5UhQwLrn0Trw+msNd/NPGEhBKR/ioWiY=
github.com/sagernet/sing v0.0.0-20220913004915-27ddefbb8921 h1:xUHzlIbdlPV/fkToIO9futp9lmKIY+72ezk/whQ8XsI=
github.com/sagernet/sing v0.0.0-20220913004915-27ddefbb8921/go.mod h1:kZvzh1VDa/Dg/Bt5WaYKU0jl5ept8KKDpl3Ay4gRtRQ=
github.com/sagernet/sing v0.0.0-20220903085538-02b9ca1cc133 h1:krnb8wKEFIdXhmJYlhJMbEcPsJFISy2fz90uHVz7hMU=
github.com/sagernet/sing v0.0.0-20220903085538-02b9ca1cc133/go.mod h1:kZvzh1VDa/Dg/Bt5WaYKU0jl5ept8KKDpl3Ay4gRtRQ=
github.com/sagernet/sing-dns v0.0.0-20220903082137-b1102b8fc961 h1:5JeqhvCGV6AQQiAO0V67Loh2eyO3JNjIQnvRF8NnTE0=
github.com/sagernet/sing-dns v0.0.0-20220903082137-b1102b8fc961/go.mod h1:vKBBy4mNJRaFuJ8H6kYIOPofsZ1JT5mgdwIlebtvnZ4=
github.com/sagernet/sing-shadowsocks v0.0.0-20220819002358-7461bb09a8f6 h1:JJfDeYYhWunvtxsU/mOVNTmFQmnzGx9dY034qG6G3g4=
github.com/sagernet/sing-shadowsocks v0.0.0-20220819002358-7461bb09a8f6/go.mod h1:EX3RbZvrwAkPI2nuGa78T2iQXmrkT+/VQtskjou42xM=
github.com/sagernet/sing-tun v0.0.0-20220828031750-185b6c880a83 h1:SoWiHYuOCVedqA7T/CJSZUUrcPGKQb2wFKEq8DphiAI=
github.com/sagernet/sing-tun v0.0.0-20220828031750-185b6c880a83/go.mod h1:76r07HS1WRcEI4mE9pFsohfTBUt1j/G9Avz6DaOP3VU=
github.com/sagernet/sing-vmess v0.0.0-20220913015714-c4ab86d40e12 h1:4HYGbTDDemgBVTmaspXbkgjJlXc3hYVjNxSddJndq8Y=
github.com/sagernet/sing-vmess v0.0.0-20220913015714-c4ab86d40e12/go.mod h1:u66Vv7NHXJWfeAmhh7JuJp/cwxmuQlM56QoZ7B7Mmd0=
github.com/sagernet/sing-vmess v0.0.0-20220907073918-72d7fdf6825f h1:6l9aXZqAl1JqXJWi89KHpWnM/moQUPGG+XiwMc+yD0A=
github.com/sagernet/sing-vmess v0.0.0-20220907073918-72d7fdf6825f/go.mod h1:u66Vv7NHXJWfeAmhh7JuJp/cwxmuQlM56QoZ7B7Mmd0=
github.com/sagernet/smux v0.0.0-20220831015742-e0f1988e3195 h1:5VBIbVw9q7aKbrFdT83mjkyvQ+VaRsQ6yflTepfln38=
github.com/sagernet/smux v0.0.0-20220831015742-e0f1988e3195/go.mod h1:yedWtra8nyGJ+SyI+ziwuaGMzBatbB10P1IOOZbbSK8=
github.com/sagernet/websocket v0.0.0-20220913015213-615516348b4e h1:7uw2njHFGE+VpWamge6o56j2RWk4omF6uLKKxMmcWvs=
github.com/sagernet/websocket v0.0.0-20220913015213-615516348b4e/go.mod h1:45TUl8+gH4SIKr4ykREbxKWTxkDlSzFENzctB1dVRRY=
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE=
github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
+2 -2
View File
@@ -80,7 +80,7 @@ func TestHysteriaSelf(t *testing.T) {
},
},
})
testSuitSimple1(t, clientPort, testPort)
testSuitSimple(t, clientPort, testPort)
}
func TestHysteriaInbound(t *testing.T) {
@@ -171,5 +171,5 @@ func TestHysteriaOutbound(t *testing.T) {
},
},
})
testSuit(t, clientPort, testPort)
testSuitSimple(t, clientPort, testPort)
}
-59
View File
@@ -122,62 +122,3 @@ func TestTrojanSelf(t *testing.T) {
})
testSuit(t, clientPort, testPort)
}
func TestTrojanPlainSelf(t *testing.T) {
startInstance(t, option.Options{
Inbounds: []option.Inbound{
{
Type: C.TypeMixed,
Tag: "mixed-in",
MixedOptions: option.HTTPMixedInboundOptions{
ListenOptions: option.ListenOptions{
Listen: option.ListenAddress(netip.IPv4Unspecified()),
ListenPort: clientPort,
},
},
},
{
Type: C.TypeTrojan,
TrojanOptions: option.TrojanInboundOptions{
ListenOptions: option.ListenOptions{
Listen: option.ListenAddress(netip.IPv4Unspecified()),
ListenPort: serverPort,
},
Users: []option.TrojanUser{
{
Name: "sekai",
Password: "password",
},
},
},
},
},
Outbounds: []option.Outbound{
{
Type: C.TypeDirect,
},
{
Type: C.TypeTrojan,
Tag: "trojan-out",
TrojanOptions: option.TrojanOutboundOptions{
ServerOptions: option.ServerOptions{
Server: "127.0.0.1",
ServerPort: serverPort,
},
Password: "password",
},
},
},
Route: &option.RouteOptions{
Rules: []option.Rule{
{
DefaultOptions: option.DefaultRule{
Inbound: []string{"mixed-in"},
Outbound: "trojan-out",
},
},
},
},
})
testSuit(t, clientPort, testPort)
}
+1 -1
View File
@@ -161,7 +161,7 @@ func testV2RayGRPCOutbound(t *testing.T, forceLite bool) {
},
},
})
testSuit(t, clientPort, testPort)
testSuitSimple(t, clientPort, testPort)
}
func TestV2RayGRPCLite(t *testing.T) {
+2 -2
View File
@@ -266,7 +266,7 @@ func TestVMessQUICSelf(t *testing.T) {
},
},
})
testSuit(t, clientPort, testPort)
testSuitSimple(t, clientPort, testPort)
}
func testV2RayTransportNOTLSSelf(t *testing.T, transport *option.V2RayTransportOptions) {
@@ -330,5 +330,5 @@ func testV2RayTransportNOTLSSelf(t *testing.T, transport *option.V2RayTransportO
},
},
})
testSuit(t, clientPort, testPort)
testSuitSimple(t, clientPort, testPort)
}
+1 -1
View File
@@ -193,5 +193,5 @@ func testV2RayWebsocketOutbound(t *testing.T, maxEarlyData uint32, earlyDataHead
},
},
})
testSuit(t, clientPort, testPort)
testSuitSimple(t, clientPort, testPort)
}
+1 -1
View File
@@ -256,7 +256,7 @@ func testVMessOutboundWithV2Ray(t *testing.T, security string, uuid uuid.UUID, g
},
},
})
testSuit(t, clientPort, testPort)
testSuitSimple(t, clientPort, testPort)
}
func testVMessSelf(t *testing.T, security string, uuid uuid.UUID, alterId int, globalPadding bool, authenticatedLength bool, packetAddr bool) {
-4
View File
@@ -8,7 +8,6 @@ import (
"net"
"net/http"
"os"
"sync"
"time"
"github.com/sagernet/sing-box/common/baderror"
@@ -29,7 +28,6 @@ type GunConn struct {
create chan struct{}
err error
readRemaining int
writeAccess sync.Mutex
}
func newGunConn(reader io.Reader, writer io.Writer, flusher http.Flusher) *GunConn {
@@ -102,9 +100,7 @@ func (c *GunConn) Write(b []byte) (n int, err error) {
grpcHeader := buf.Get(5)
grpcPayloadLen := uint32(1 + varuintLen + len(b))
binary.BigEndian.PutUint32(grpcHeader[1:5], grpcPayloadLen)
c.writeAccess.Lock()
_, err = bufio.Copy(c.writer, io.MultiReader(bytes.NewReader(grpcHeader), bytes.NewReader(protobufHeader[:varuintLen+1]), bytes.NewReader(b)))
c.writeAccess.Unlock()
buf.Put(grpcHeader)
if c.flusher != nil {
c.flusher.Flush()
+2 -1
View File
@@ -14,7 +14,8 @@ import (
E "github.com/sagernet/sing/common/exceptions"
M "github.com/sagernet/sing/common/metadata"
N "github.com/sagernet/sing/common/network"
"github.com/sagernet/websocket"
"github.com/gorilla/websocket"
)
var _ adapter.V2RayClientTransport = (*Client)(nil)
+2 -1
View File
@@ -11,7 +11,8 @@ import (
C "github.com/sagernet/sing-box/constant"
E "github.com/sagernet/sing/common/exceptions"
"github.com/sagernet/websocket"
"github.com/gorilla/websocket"
)
type WebsocketConn struct {
+2 -1
View File
@@ -19,7 +19,8 @@ import (
M "github.com/sagernet/sing/common/metadata"
N "github.com/sagernet/sing/common/network"
sHttp "github.com/sagernet/sing/protocol/http"
"github.com/sagernet/websocket"
"github.com/gorilla/websocket"
)
var _ adapter.V2RayServerTransport = (*Server)(nil)