Skip to content

Commit d16367b

Browse files
authored
Merge pull request #102 from Moroka8/main
feat: поддержка TCP-режима для VLESS
2 parents 184778a + 58a9b1e commit d16367b

File tree

11 files changed

+1123
-167
lines changed

11 files changed

+1123
-167
lines changed

.github/workflows/.golangci.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
version: "2"
2+
run:
3+
tests: true
4+
linters:
5+
enable:
6+
- bodyclose
7+
- misspell
8+
- revive
9+
settings:
10+
errcheck:
11+
check-type-assertions: true
12+
check-blank: true
13+
exclude-functions:
14+
- (net.PacketConn).WriteTo
15+
- (net.Conn).Write
16+
- encoding/json.MarshalIndent
17+
- (*github.com/pion/dtls/v3.Conn).SetDeadline
18+
govet:
19+
disable:
20+
- fieldalignment
21+
enable-all: true
22+
revive:
23+
rules:
24+
- name: blank-imports
25+
- name: dot-imports
26+
- name: error-return
27+
- name: error-strings
28+
- name: error-naming
29+
- name: exported
30+
- name: if-return
31+
- name: increment-decrement
32+
- name: var-naming
33+
- name: var-declaration
34+
- name: package-comments
35+
- name: range
36+
- name: receiver-naming
37+
- name: time-naming
38+
- name: unexported-return
39+
- name: indent-error-flow
40+
- name: errorf
41+
exclusions:
42+
generated: lax
43+
presets:
44+
- comments
45+
- common-false-positives
46+
- legacy
47+
- std-error-handling
48+
paths:
49+
- third_party$
50+
- builtin$
51+
- examples$
52+
issues:
53+
max-issues-per-linter: 0
54+
max-same-issues: 0
55+
exclude-rules:
56+
- linters:
57+
- errcheck
58+
source: "doRequest|packetPool\\.Get"
59+
formatters:
60+
exclusions:
61+
generated: lax
62+
paths:
63+
- third_party$
64+
- builtin$
65+
- examples$

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Set up Go
2121
uses: actions/setup-go@v6
2222
with:
23-
go-version: '1.25.5'
23+
go-version: 'stable'
2424

2525
- name: Cache Go modules
2626
uses: actions/cache@v5
@@ -47,7 +47,7 @@ jobs:
4747
- name: Run golangci-lint
4848
uses: golangci/golangci-lint-action@v9
4949
with:
50-
version: v2.8.0
50+
version: latest
5151
args: --timeout=5m ./...
5252
env:
5353
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -87,7 +87,7 @@ jobs:
8787
- name: Set up Go
8888
uses: actions/setup-go@v6
8989
with:
90-
go-version: '1.25.5'
90+
go-version: 'stable'
9191

9292
# Install Android NDK for android rows and expose ndk-path output
9393
- name: Setup Android NDK

README.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,120 @@ curl -L -o client https://github.com/cacggghp/vk-turn-proxy/releases/latest/down
422422

423423
</details>
424424

425+
## VLESS-режим
426+
427+
Если WireGuard блокируется DPI, можно использовать VLESS через флаг `-vless`. В этом режиме вместо UDP-пакетов пробрасываются TCP-соединения через TURN-туннель с помощью KCP и smux.
428+
429+
### Настройка
430+
1. На VPS установить Xray с VLESS inbound
431+
2. Запустить `server` с флагом `-vless`
432+
3. На клиенте запустить `client` с флагом `-vless`
433+
4. Настроить Xray/v2rayN клиент с VLESS outbound на `127.0.0.1:9000`
434+
435+
### Сервер (VPS)
436+
```
437+
./server -listen 0.0.0.0:56000 -connect 127.0.0.1:443 -vless
438+
```
439+
440+
#### Docker
441+
```
442+
docker run -p 56000:56000/udp -e CONNECT_ADDR=127.0.0.1:443 -e VLESS_MODE=true vk-turn-proxy
443+
```
444+
445+
### Клиент
446+
```
447+
./client -peer <ip сервера>:56000 -vk-link <VK ссылка> -listen 127.0.0.1:9000 -vless
448+
```
449+
450+
<details>
451+
452+
<summary>
453+
Xray клиент (config.json)
454+
</summary>
455+
456+
```json
457+
{
458+
"inbounds": [
459+
{
460+
"protocol": "socks",
461+
"listen": "127.0.0.1",
462+
"port": 1080,
463+
"settings": {
464+
"udp": true
465+
},
466+
"sniffing": {
467+
"enabled": true,
468+
"destOverride": ["http", "tls"]
469+
}
470+
}
471+
],
472+
"outbounds": [
473+
{
474+
"protocol": "vless",
475+
"settings": {
476+
"vnext": [
477+
{
478+
"address": "127.0.0.1",
479+
"port": 9000,
480+
"users": [
481+
{
482+
"id": "<UUID>",
483+
"encryption": "none"
484+
}
485+
]
486+
}
487+
]
488+
},
489+
"streamSettings": {
490+
"network": "tcp",
491+
"security": "none"
492+
}
493+
}
494+
]
495+
}
496+
```
497+
498+
</details>
499+
500+
<details>
501+
502+
<summary>
503+
Xray сервер (config.json)
504+
</summary>
505+
506+
```json
507+
{
508+
"inbounds": [
509+
{
510+
"protocol": "vless",
511+
"listen": "127.0.0.1",
512+
"port": 443,
513+
"settings": {
514+
"clients": [
515+
{
516+
"id": "<тот же UUID>",
517+
"level": 0
518+
}
519+
],
520+
"decryption": "none"
521+
}
522+
}
523+
],
524+
"outbounds": [
525+
{
526+
"protocol": "freedom",
527+
"settings": {
528+
"domainStrategy": "UseIPv4"
529+
}
530+
}
531+
]
532+
}
533+
```
534+
535+
</details>
536+
537+
425538
## Direct mode
426539

427540
С флагом `-no-dtls` можно отправлять пакеты без обфускации DTLS и подключаться к обычным серверам Wireguard. Может привести к бану от вк/яндекса.
541+

0 commit comments

Comments
 (0)