Compare commits

...

88 Commits

Author SHA1 Message Date
patterniha
97d7f1ee19 Update Serverless-for-Iran (#238)
Persian explanation: https://github.com/patterniha/Serverless-for-Iran
2025-09-18 09:23:04 +00:00
rnotlnglgq
c7e8d285a0 Deprecate VLESS-TCP-TLS-WS and add VLESS-XHTTP-Reality (#230)
* tag VLESS-TCP-TLS-WS as deprecated instead of recommended

* Add a minimal  VLESS-XHTTP-Reality configuration
2025-07-20 11:57:59 -04:00
风扇滑翔翼
d4e592b842 Remove old xtls 2025-07-17 12:07:06 +00:00
风扇滑翔翼
7ad5f48c20 Revert "All 127.0.0.1 > ::1"
Changing them will result in incompatibility with old xray, and the related pr has not even been merged yet
2025-07-17 12:02:30 +00:00
xqzr
99b5e538cb All 127.0.0.1 > ::1 2025-06-19 01:37:19 +08:00
nekolsd
2fb8a67787 Change 127.0.0.1 to ::1 2025-06-04 09:30:44 +08:00
y9938
68bc308422 fix: update generate.sh to use server.jsonc (#228)
Replace server.json with server.jsonc in generate.sh to fix errors like
'sed: can't read server.json: No such file or directory' when running
'./generate.sh -m'. This aligns with the file rename in commit #199.
Also remove trailing spaces automatically cleaned by editor.

Closes #227
2025-04-26 20:53:15 +08:00
patterniha
fc906aef53 Serverless-for-Iran: Change domain-fronting fake-sni for visiting 1.1.1.1 (#223) 2025-03-21 09:57:02 +00:00
xqzr
c070b9aec9 Add QUIC flood detected Tip 2025-03-18 19:27:25 +08:00
xqzr
02d0f95085 Update client.jsonc 2025-03-15 04:28:28 +08:00
patterniha
08e20d464b Serverless-for-Iran: Remove removed tcpNoDelay from configs (#221) 2025-03-10 11:35:41 +00:00
patterniha
1d78c64352 Serverless-for-Iran: fixing some issues about UDP routing and noise (#219) 2025-03-04 15:30:36 +00:00
patterniha
400021a816 MMDF: Add tip for certificate importing 2025-02-28 00:20:08 +08:00
RPRX
643468e82f Add LICENSE (CC-BY-SA-4.0) 2025-02-23 16:08:30 +00:00
RPRX
73272ee478 Serverless-for-Iran: Update descriptions 2025-02-23 13:39:45 +00:00
RPRX
558cd38e65 Update README.md 2025-02-23 13:10:17 +00:00
RPRX
5c6d8980c2 MITM-Domain-Fronting: Update config.jsonc 2025-02-23 13:07:42 +00:00
patterniha
297f694abc Serverless-for-Iran: Update README.md (#215) 2025-02-23 12:53:54 +00:00
patterniha
0815c1d30a Add Serverless-for-Iran (#213)
Co-authored-by: RPRX <63339210+RPRX@users.noreply.github.com>
2025-02-23 11:27:40 +00:00
iopq
4c95f5e4c9 Add missing "encryption": "none" (#214)
VLESS requires encryption: none for every user
2025-02-20 00:14:25 +08:00
风扇滑翔翼
c9a5520fff Update mitm config 2025-02-07 22:43:48 +08:00
风扇滑翔翼
1bfdd6d85e Update mitm config 2025-02-07 20:28:17 +08:00
风扇滑翔翼
ec8cd116ac MITM: More tip 2025-02-04 16:45:19 +00:00
风扇滑翔翼
2af21bbd5b MITM: Add version tip 2025-02-04 16:22:33 +00:00
风扇滑翔翼
7fce9e9d35 Add MITM 2025-02-04 15:51:20 +00:00
xqzr
34a5900403 xmux Use def value
https://github.com/XTLS/Xray-core/discussions/4113#discussioncomment-11704492
2025-01-01 22:04:23 +08:00
xqzr
007b28f642 Merge pull request #206 from XTLS/xqzr-patch-2
Fix/Add `downloadsettings` tip
2024-12-27 23:16:08 +08:00
xqzr
bfe4f9e42a Add downloadsettings tip in server.jsonc 2024-12-27 23:11:06 +08:00
xqzr
0590b0096b Fix downloadsettings tip
缺少了一些提示...
2024-12-27 23:07:29 +08:00
xqzr
6405ff9c78 Add downloadSettings for H2 (#204) 2024-12-26 12:05:46 +08:00
xqzr
44d9e49acb cMaxReuseTimes > hMaxRequestTimes
**严谨**
https://github.com/XTLS/Xray-core/pull/4163
2024-12-23 18:26:06 +08:00
xqzr
5f96ba40bc Add VLESS-XHTTP3-Nginx
#203
2024-12-15 19:30:12 +08:00
xqzr
a5ba55741d Create client.jsonc 2024-12-13 18:51:12 +08:00
xqzr
c1dc2f7c14 Create server.jsonc 2024-12-13 18:29:48 +08:00
xqzr
5f18955ff6 Create nginx.conf 2024-12-13 18:23:33 +08:00
WH-2099
d65029fd20 typo blcok → block (#201) 2024-11-09 21:43:06 +08:00
风扇滑翔翼
3a45e115e7 Do some rename 2024-11-02 07:37:46 +00:00
yuhan6665
061321ad1c Update all json file to jsonc (#199) 2024-10-21 11:49:47 -04:00
风扇滑翔翼
c6ec3122f5 Add VLESS-TCP-REALITY(Without being stolen) 2024-10-20 12:05:33 +00:00
yuhan6665
bebf51e5f7 Add VLESS-H3-Caddy two modes 2024-10-17 04:54:23 -04:00
yuhan6665
2fe711231a Refactor VLESS-HTTP-Caddy folder 2024-10-17 03:58:05 -04:00
yuhan6665
301c7c0193 Delete Quic 2024-10-17 03:40:05 -04:00
mmmray
ca705fbd0b SplitHTTP: Add suggestion to disable nginx access logs 2024-08-31 11:58:34 +02:00
xor
129be747c3 Fix caddy reverse proxy latency (#195) 2024-08-26 10:22:31 -04:00
xqzr
34d78cc926 Starting with "application/grpc" 2024-08-02 22:33:20 +08:00
xqzr
8c9e1c5f4f Starting with "application/grpc" 2024-08-02 22:32:28 +08:00
IRN-Kawakaze
2988294bdc Fix incorrect formatting. (#192) 2024-07-22 23:28:03 +02:00
IRN-Kawakaze
4c64126604 Add SplitHTTP-HTTP3 config (#191) 2024-07-22 21:42:06 +02:00
chshouyu
d9d8f77541 Update websocket path ed from 2048 to 2560 2024-06-23 03:23:55 +08:00
mmmray
9d40021c5b Simplify SplitHTTP further, and add Caddyfile (#188)
* Simplify SplitHTTP further, and add Caddyfile

* raise log level

* enable udp

---------

Co-authored-by: 风扇滑翔翼 <Fangliding.fshxy@outlook.com>
2024-06-22 04:36:22 +08:00
iamtrazy
f605cda6a0 fixes for splitHttp nginx conf (#187)
* Update nginx.conf

removed unnecessary components from nginx conf

* fix: minor changes
2024-06-21 23:39:00 +08:00
iamtrazy
2a8fe45acd feat: added splitHttp nginx reverse proxy exmaple 2024-06-21 10:59:39 -04:00
zonescape
0ba800fd7c fix port datatype 2024-05-02 19:43:46 +08:00
风扇滑翔翼
ecefc32120 Remove deprecated config 2024-03-22 05:22:18 +00:00
风扇滑翔翼
f42d177c46 #172 2024-03-22 04:56:11 +00:00
xqzr
cb619022bb keepalive_timeout 30m; 2024-01-29 20:53:39 +08:00
xqzr
059bdf1a97 Update README.md 2024-01-29 20:51:27 +08:00
xqzr
e0548899bb Update README.md 2024-01-29 20:50:34 +08:00
xqzr
1732809e5f Update README.ENG.md 2024-01-29 20:46:45 +08:00
チセ
a47a984a08 Update config_server.json 2024-01-20 16:39:14 -05:00
kiriknik
7f4e176d9b Update generate.sh
A little patch to generate qr code)
2023-12-29 10:46:15 -05:00
xqzr
7486946d72 Add IPv6 Listen 2023-12-04 17:51:17 +08:00
xqzr
4ea3d4e023 Change all timeout 2023-12-04 17:47:05 +08:00
xqzr
a736984061 Update nginx.conf 2023-12-04 17:42:52 +08:00
xqzr
5ee22a1aa4 Update README.md 2023-12-04 17:42:25 +08:00
xqzr
33595f9c0d Update README.ENG.md 2023-12-04 17:40:36 +08:00
xqzr
152dd028c6 Update README.md 2023-12-04 17:38:28 +08:00
xqzr
08978ee233 Add IPv6 Listen 2023-11-02 21:51:51 +08:00
xqzr
97210cfd0e Add IPv6 Listen 2023-11-02 21:51:12 +08:00
xqzr
9a6a9ab54a add permit_without_stream 2023-11-02 21:34:39 +08:00
woodlyer
31a1c6cbf5 Update config_client.jsonc
add shortId
2023-09-07 12:26:51 -04:00
woodlyer
13d0158470 Update config_server.jsonc 2023-09-07 12:26:19 -04:00
yuhan6665
0e8377e3c2 Update README.md 2023-09-04 17:32:42 -04:00
yuhan6665
9910881d58 Update README.md 2023-09-04 10:36:12 -04:00
KoinuDayo
2aea6cb507 Add VLESS-TCP-XTLS-Vision-REALITY 2023-09-04 10:16:41 -04:00
Mohammad Reza Gharabaghi
2dc42bc0df Add gRPC over REALITY 2023-05-21 22:31:23 -04:00
bghandchi
004c490c7b Auto generate script for all in one configs (#145)
* fixes default template value for password at server.json:237

* Auto config generation script

* Readme fix

* remove ?ed=2048

* remove h2 tcp
2023-04-13 13:04:12 -04:00
yuhan6665
d35c6f5aaa Update README.ENG.md url fix
Update vmess_ws_tls.json comment translate

Update vmess_tcp_tls.json comment translate

Update vless_ws_tls.json comment trnslate

Update vless_tcp_xtls.json comment translate

Update vless_tcp_tls.json comment translate

Update trojan_tcp_tls.json comment translate

Create README.ENG.md

Update README.md add link README.ENG.md

Update README.md add link README.ENG.md

Create README.ENG.md

Update README.md add link README.ENG.md

Create README.ENG.md

Update client.json comment transalate

Update server.json comment translate

Update README.md add english translate

Update README.md add english link

Create README.ENG.md

Update Caddyfile comment translate

Update client.json comment translate

Update server.json comment translate

Update README.md add link README.ENG.md

Create RREADME.ENG.md

Update config_client_tcp_tls.json translate comment

Update config_client_ws_tls.json translate comment

Update config_server.json comment translate

Update README.md add link README.ENG.md

Create README.ENG.md

Update config_client.json comment translate

Update config_server.json comment translate

Update client.json translate comment

Update server.json translate comment

Update README.md add link README.ENG.md

Create README.ENG.md

Update server.json translate comment

Update README.md add link README.ENG.md

Update README.md

Create README.ENG.md

Co-authored-by: lk29 <12291632+lk29@users.noreply.github.com>
2023-04-05 21:08:31 -04:00
stupidloud
28052d756d Update client.json 2023-03-31 10:24:46 -04:00
lk29
11609f587f translate ENGLISH README.md 2023-03-11 20:39:49 -05:00
lk29
3bdf2a23ff Update README.md add link README.ENG.md 2023-03-11 20:38:27 -05:00
lk29
cebb145398 add ENGLISH translate (#133)
* add translate ENGLISH version README.md

* Update README.md add link README.ENG.md

* Update config_server.json - translation of comments into english

* Update config_client.json translation of comments into english

* Update config_server.json translation of comments into english

* Update config_client.json, translation of comments into english

* Update config_server.json translation of comments into english
2023-03-11 20:37:52 -05:00
chika0801
5ae00c5bb2 Update config_server.json 2023-03-08 11:02:40 -05:00
chika0801
ad496cb607 Vision配置示例更新 (#128)
* Update config_client.json

* Update config_server.json

* Update config_server.json

* Update config_server.json

* Update config_server.json

* Create nginx.conf

* Create README.md
2023-03-06 23:57:12 -05:00
Bahman
ae379bf770 fixes default template value for password at server.json:237 2023-02-17 09:47:20 -05:00
ws2bhhh
4effea1dc1 Update client.json
消除可能的歧义
2023-02-04 12:22:34 -05:00
ws2bhhh
5c0b1523f1 Update Caddyfile
消除可能的歧义
2023-02-04 12:22:07 -05:00
Saoshyanet
6c979e4f0e Introduce sed for fast replacement in all-in-one readme. (#117)
* Fast replacement using sed

* Fast replacement using sed
2023-02-04 12:19:22 -05:00
155 changed files with 3810 additions and 653 deletions

View File

@@ -37,13 +37,26 @@ VMESS-gRPC Request ------> Xray Vless-TCP-XTLS(443) ----**alpn=h2**----> fallbac
## What to change before use?
* Xray server.json
* **SSL Certificates and keys** absolute paths in Vless-TCP-XTLS (`inbounds[0].streamSettings.xtlsSettings.certificates`)
* For the main domain:
* `sed -i 's/\/etc\/ssl\/example.com\/domain.pem/PATH_TO_YOUR_FULLCHAIN/g' *`
* `sed -i 's/\/etc\/ssl\/example.com\/domain-key.pem/PATH_TO_THE_FULLCHAINS_CERT/g' *`
* For the domain behind cdn:
* `sed -i 's/\/etc\/ssl\/behindcdn.com\/domain.pem/PATH_TO_YOUR_FULLCHAIN/g' *`
* `sed -i 's/\/etc\/ssl\/behindcdn.com\/domain-key.pem/PATH_TO_THE_FULLCHAINS_CERT/g' *`
* **Your Domain** in both and server (for fallbacks section) and client configs.
* `sed -i 's/example.com/YOUR_DOMAIN/g' *`
* `sed -i 's/behindcdn.com/YOUR_CDN_DOMAIN/g' *` (if you don't have one, remove the config for cdn domain from inbounds[0].streamSettings.tlsSettings.certificates in server.json)
* **Password** of Trojan and ShadowSocks configs
* `sed -i 's/desdemona99/YOUR_PASSWORD/g' *`
* **UUID** of Vless and VMESS configs
* `sed -i 's/90e4903e-66a4-45f7-abda-fd5d5ed7f797/YOUR_UUID/g' *`
* **(Optional)** Path of all sub-configs. For **Websocket**-->`wsSettings.path`, for **TCP**-->`tcpSettings.header.request.path`, for **gRPC**-->`grpcSettings.serviceName` and for **H2**-->`httpSettings.path`.
* **(Optional)** The SNIs of H2 fallbacks (`inbounds[0].settings.fallbacks.[].name`) could also be changed but they should be consistent between client and server. (Read the notes on HTTP2 inbounds)
* Nginx nginx.conf
* Domain names
* `sed -i 's/example.com/YOUR_DOMAIN/g' *`
* `sed -i 's/behindcdn.com/YOUR_CDN_DOMAIN/g' *` (if you don't have one, leave YOUR_CDN_DOMAIN blank.)
* **(Optional)** If gRPC serviceNames are changed in server.json, they **should** also be changed in Nginx config
## Notes:
@@ -63,14 +76,27 @@ VMESS-gRPC Request ------> Xray Vless-TCP-XTLS(443) ----**alpn=h2**----> fallbac
| Combination | Link |
| ----------- | ---- |
| Trojan-TCP | `trojan://desdemona99@example.com:443?security=tls&type=tcp#Trojan-TCP` |
| Trojan-WS | `trojan://desdemona99@example.com:443?security=tls&type=ws&path=/trojanws?ed=2048#Trojna-WS` |
| Trojan-WS | `trojan://desdemona99@example.com:443?security=tls&type=ws&path=/trojanws#Trojna-WS` |
| Trojan-gRPC | `trojan://desdemona99@example.com:443?security=tls&type=grpc&serviceName=trgrpc#Trojan-gRPC` |
| Trojan-H2 | `trojan://desdemona99@example.com:443?sni=trh2o.example.com&security=tls&type=http&path=/trh2#Trojan-H2` |
| Vless-TCP | `vless://90e4903e-66a4-45f7-abda-fd5d5ed7f797@example.com:443?security=tls&type=tcp#Vless-TCP` |
| Vless-WS | `vless://90e4903e-66a4-45f7-abda-fd5d5ed7f797@example.com:443?security=tls&type=ws?ed=2048&path=/vlws#Vless-WS` |
| Vless-WS | `vless://90e4903e-66a4-45f7-abda-fd5d5ed7f797@example.com:443?security=tls&type=ws&path=/vlws#Vless-WS` |
| Vless-gRPC | `vless://90e4903e-66a4-45f7-abda-fd5d5ed7f797@example.com:443?security=tls&type=grpc&serviceName=vlgrpc#Vless-gRPC` |
| Vless-H2 | `vless://90e4903e-66a4-45f7-abda-fd5d5ed7f797@example.com:443?sni=vlh2o.example.com&security=tls&type=http&path=/vlh2#Vless-H2` |
| VMESS-TCP | `vmess://ewogICAgImFkZCI6ICJleGFtcGxlLmNvbSIsCiAgICAiYWlkIjogIjAiLAogICAgImhvc3QiOiAiIiwKICAgICJpZCI6ICI5MGU0OTAzZS02NmE0LTQ1ZjctYWJkYS1mZDVkNWVkN2Y3OTciLAogICAgIm5ldCI6ICJ0Y3AiLAogICAgInBhdGgiOiAiL3ZtdGMiLAogICAgInBvcnQiOiAiNDQzIiwKICAgICJwcyI6ICJWTUVTUy1UQ1AiLAogICAgInNjeSI6ICJub25lIiwKICAgICJzbmkiOiAiIiwKICAgICJ0bHMiOiAidGxzIiwKICAgICJ0eXBlIjogImh0dHAiLAogICAgInYiOiAiMiIKfQo=` |
| VMESS-WS | `vmess://ewogICAgImFkZCI6ICJleGFtcGxlLmNvbSIsCiAgICAiYWlkIjogIjAiLAogICAgImhvc3QiOiAiIiwKICAgICJpZCI6ICI5MGU0OTAzZS02NmE0LTQ1ZjctYWJkYS1mZDVkNWVkN2Y3OTciLAogICAgIm5ldCI6ICJ3cyIsCiAgICAicGF0aCI6ICIvdm13cyIsCiAgICAicG9ydCI6ICI0NDMiLAogICAgInBzIjogIlZNRVNTLVdTIiwKICAgICJzY3kiOiAibm9uZSIsCiAgICAic25pIjogIiIsCiAgICAidGxzIjogInRscyIsCiAgICAidHlwZSI6ICIiLAogICAgInYiOiAiMiIKfQo=` |
| VMESS-gRPC | `vmess://ewogICAgImFkZCI6ICJleGFtcGxlLmNvbSIsCiAgICAiYWlkIjogIjAiLAogICAgImhvc3QiOiAiIiwKICAgICJpZCI6ICI5MGU0OTAzZS02NmE0LTQ1ZjctYWJkYS1mZDVkNWVkN2Y3OTciLAogICAgIm5ldCI6ICJncnBjIiwKICAgICJwYXRoIjogInZtZ3JwYyIsCiAgICAicG9ydCI6ICI0NDMiLAogICAgInBzIjogIlZNRVNTLWdSUEMiLAogICAgInNjeSI6ICJub25lIiwKICAgICJzbmkiOiAiIiwKICAgICJ0bHMiOiAidGxzIiwKICAgICJ0eXBlIjogImh0dHAiLAogICAgInYiOiAiMiIKfQo=` |
| VMESS-H2 | `vmess://ewogICAgImFkZCI6ICJleGFtcGxlLmNvbSIsCiAgICAiYWlkIjogIjAiLAogICAgImhvc3QiOiAiIiwKICAgICJpZCI6ICI5MGU0OTAzZS02NmE0LTQ1ZjctYWJkYS1mZDVkNWVkN2Y3OTciLAogICAgIm5ldCI6ICJodHRwIiwKICAgICJwYXRoIjogIi92bWgyIiwKICAgICJwb3J0IjogIjQ0MyIsCiAgICAicHMiOiAiVk1FU1MtSDIiLAogICAgInNjeSI6ICJub25lIiwKICAgICJzbmkiOiAidm1oMm8uZXhhbXBsZS5jb20iLAogICAgInRscyI6ICJ0bHMiLAogICAgInR5cGUiOiAiaHR0cCIsCiAgICAidiI6ICIyIgp9Cg==` |
| VMESS-H2 | `vmess://ewogICAgImFkZCI6ICJleGFtcGxlLmNvbSIsCiAgICAiYWlkIjogIjAiLAogICAgImhvc3QiOiAiIiwKICAgICJpZCI6ICI5MGU0OTAzZS02NmE0LTQ1ZjctYWJkYS1mZDVkNWVkN2Y3OTciLAogICAgIm5ldCI6ICJodHRwIiwKICAgICJwYXRoIjogIi92bWgyIiwKICAgICJwb3J0IjogIjQ0MyIsCiAgICAicHMiOiAiVk1FU1MtSDIiLAogICAgInNjeSI6ICJub25lIiwKICAgICJzbmkiOiAidm1oMm8uZXhhbXBsZS5jb20iLAogICAgInRscyI6ICJ0bHMiLAogICAgInR5cGUiOiAiaHR0cCIsCiAgICAidiI6ICIyIgp9Cg==` |
## Config generation script
To make all the necessary changes to all the files in this folder a simple script is provided.
### Steps
* Open `generate.sh` and change the top lines to your correct values.
* Run `bash generate.sh -m` inside this folder.
* All the files are changed and your config links are stored in `result.txt`
* Run `bash generate.sh -b` to get one base64 string for all of your configs.
* Run `bash generate.sh -q` to get separate qr codes for all your configs.
* Run `bash generate.sh -r` to revert all the changes. This is necessary for generating configs with new values.
### Important note
Run `-b` and `-q` only after running `-m`. The script should run inside this folder.

View File

@@ -28,7 +28,7 @@
"streamSettings": {
"network": "ws",
"wsSettings": {
"path": "/ssws?ed=2048"
"path": "/ssws?ed=2560"
},
"security": "tls",
"tlsSettings": {

View File

@@ -27,7 +27,7 @@
"streamSettings": {
"network": "ws",
"wsSettings": {
"path": "/trojanws?ed=2048"
"path": "/trojanws?ed=2560"
},
"security": "tls",
"tlsSettings": {

View File

@@ -33,7 +33,7 @@
"streamSettings": {
"network": "ws",
"wsSettings": {
"path": "/vmws?ed=2048"
"path": "/vmws?ed=2560"
},
"security": "tls",
"tlsSettings": {

View File

@@ -32,7 +32,7 @@
"streamSettings": {
"network": "ws",
"wsSettings": {
"path": "/vlws?ed=2048"
"path": "/vlws?ed=2560"
},
"security": "tls",
"tlsSettings": {

View File

@@ -0,0 +1,160 @@
#!/bin/bash
#################################
# main domain #
#################################
export main_domain="your.domain.com" # Change this to the correct value
export main_domain_crt="\/path\/to\/main\/domain\/fullchain.pem" # Change this to the correct value
export main_domain_key="\/path\/to\/main\/domain\/privkey.pem" # Change this to the correct value
#################################
# behind cdn domain #
#################################
export cdn_domain="" # Change this to the correct value
export cdn_domain_crt="\/path\/to\/cdn\/domain\/fullchain.pem" # Change this to the correct value
export cdn_domain_key="\/path\/to\/cdn\/domain\/privkey.pem" # Change this to the correct value
#################################
# uuid/pass #
#################################
export myid=`xray uuid` # (optional) Let xray pick a random uuid or change it
export mypass=`date | md5sum | cut -c -15` # (optional) Set a password or let script pick one at random
#######################################################################################
#######################################################################################
###### Do not change anything below this line unless you know what you're doing. ######
#######################################################################################
#######################################################################################
#################################
# fake data #
#################################
export fake_domain="example.com"
export fake_cdn_domain="behindcdn.com"
export fakepass="desdemona99"
export fakeid="90e4903e-66a4-45f7-abda-fd5d5ed7f797"
export fake_domain_crt_path="\/etc\/ssl\/example.com\/domain.pem"
export fake_domain_key_path="\/etc\/ssl\/example.com\/domain-key.pem"
export fake_cdn_domain_crt_path="\/etc\/ssl\/behindcdn.com\/domain.pem"
export fake_cdn_domain_key_path="\/etc\/ssl\/behindcdn.com\/domain-key.pem"
Help()
{
echo "*************************************************************************"
echo "*************************************************************************"
echo "Please read the contents of this file and change all the required fields."
echo "*************************************************************************"
echo "*************************************************************************"
echo
echo
echo "Commands"
echo
echo "m Make and store the configs in result.txt."
echo "r Revert all the changes."
echo "q Print the qr codes of configs in terminal. Run this after running with -m."
echo "b Print one base64 link for all configs in terminal. Run this after running with -m."
echo
echo
echo "Usage: "
echo
echo " bash setup.sh <-command> "
echo
}
Revert()
{
git restore client.configs/* server.jsonc nginx.conf
}
Make()
{
#################################
# main domain #
#################################
sed -i "s/$fake_domain_crt_path/$main_domain_crt/g" server.jsonc client.configs/* nginx.conf
sed -i "s/$fake_domain_key_path/$main_domain_key/g" server.jsonc client.configs/* nginx.conf
sed -i "s/$fake_domain/$main_domain/g" server.jsonc client.configs/* nginx.conf
#################################
# behind cdn domain #
#################################
if [ "$cdn_domain" == "" ]; then
echo "No domain behind cdn set. Removing related fields."
sed -i "146 s/.$//" server.jsonc
sed -i "147,152d" server.jsonc
fi
sed -i "s/$fake_cdn_domain_crt_path/$cdn_domain_crt/g" server.jsonc client.configs/* nginx.conf
sed -i "s/$fake_cdn_domain_key_path/$cdn_domain_key/g" server.jsonc client.configs/* nginx.conf
sed -i "s/$fake_cdn_domain/$cdn_domain/g" server.jsonc client.configs/* nginx.conf
#################################
# uuid/pass #
#################################
sed -i "s/$fakeid/$myid/g" server.jsonc client.configs/* nginx.conf
sed -i "s/$fakepass/$mypass/g" server.jsonc client.configs/* nginx.conf
#################################
# configs #
#################################
rm result.txt
touch result.txt
#grep "| Trojan-TCP |" README.md | cut -f2 -d"\`" | sed "s/$fake_domain/$main_domain/g" | sed "s/$fakepass/$mypass/g" >> result.txt
grep "| Trojan-WS |" README.md | cut -f2 -d"\`" | sed "s/$fake_domain/$main_domain/g" | sed "s/$fakepass/$mypass/g" >> result.txt
grep "| Trojan-gRPC |" README.md | cut -f2 -d"\`" | sed "s/$fake_domain/$main_domain/g" | sed "s/$fakepass/$mypass/g" >> result.txt
#grep "| Trojan-H2 |" README.md | cut -f2 -d"\`" | sed "s/$fake_domain/$main_domain/g" | sed "s/$fakepass/$mypass/g" >> result.txt
#grep "| Vless-TCP |" README.md | cut -f2 -d"\`" | sed "s/$fake_domain/$main_domain/g" | sed "s/$fakeid/$myid/g" >> result.txt
grep "| Vless-WS |" README.md | cut -f2 -d"\`" | sed "s/$fake_domain/$main_domain/g" | sed "s/$fakeid/$myid/g" >> result.txt
grep "| Vless-gRPC |" README.md | cut -f2 -d"\`" | sed "s/$fake_domain/$main_domain/g" | sed "s/$fakeid/$myid/g" >> result.txt
#grep "| Vless-H2 |" README.md | cut -f2 -d"\`" | sed "s/$fake_domain/$main_domain/g" | sed "s/$fakeid/$myid/g" >> result.txt
#grep "| VMESS-TCP |" README.md | cut -f2 -d"\`" | cut -c 9- | base64 -d | sed "s/$fake_domain/$main_domain/g" | sed "s/$fakeid/$myid/g" | base64 -w 0 | sed "s/^/vmess:\/\//" >> result.txt
grep "| VMESS-WS |" README.md | cut -f2 -d"\`" | cut -c 9- | base64 -d | sed "s/$fake_domain/$main_domain/g" | sed "s/$fakeid/$myid/g" | base64 -w 0 | sed "s/^/\nvmess:\/\//" >> result.txt
grep "| VMESS-gRPC |" README.md | cut -f2 -d"\`" | cut -c 9- | base64 -d | sed "s/$fake_domain/$main_domain/g" | sed "s/$fakeid/$myid/g" | base64 -w 0 | sed "s/^/\nvmess:\/\//" >> result.txt
#grep "| VMESS-H2 |" README.md | cut -f2 -d"\`" | cut -c 9- | base64 -d | sed "s/$fake_domain/$main_domain/g" | sed "s/$fakeid/$myid/g" | base64 -w 0 | sed "s/^/\nvmess:\/\//" >> result.txt
echo >> result.txt
}
Print64()
{
cat result.txt | base64 -w 0
echo
}
Printqr()
{
while read line; do
export t=`echo $line | cut -c -2`
if [ "$t" == "vm" ]; then
echo $line | cut -c 9- | base64 -d | grep "\"ps\":" | sed -n -e 's/"ps": "//p' | sed -n -e 's/",//p' | sed -n -e 's/ *//p'
curl qrcode.show -d $line
else
echo $line | sed -n -e 's/^.*#//p'
curl qrcode.show -d $line
fi
done < result.txt
}
while getopts "mrqb" option; do
case $option in
r)
Revert
exit;;
m)
Make
exit;;
b)
Print64
exit;;
q)
Printqr
exit;;
\?)
Help
exit;;
esac
done
Help

View File

@@ -234,7 +234,7 @@
"clients": [
{
"email":"general@trojan-ws",
"password": "90e4903e-66a4-45f7-abda-fd5d5ed7f797",
"password": "desdemona99",
"level": 0
}
]

428
LICENSE Normal file
View File

@@ -0,0 +1,428 @@
Attribution-ShareAlike 4.0 International
=======================================================================
Creative Commons Corporation ("Creative Commons") is not a law firm and
does not provide legal services or legal advice. Distribution of
Creative Commons public licenses does not create a lawyer-client or
other relationship. Creative Commons makes its licenses and related
information available on an "as-is" basis. Creative Commons gives no
warranties regarding its licenses, any material licensed under their
terms and conditions, or any related information. Creative Commons
disclaims all liability for damages resulting from their use to the
fullest extent possible.
Using Creative Commons Public Licenses
Creative Commons public licenses provide a standard set of terms and
conditions that creators and other rights holders may use to share
original works of authorship and other material subject to copyright
and certain other rights specified in the public license below. The
following considerations are for informational purposes only, are not
exhaustive, and do not form part of our licenses.
Considerations for licensors: Our public licenses are
intended for use by those authorized to give the public
permission to use material in ways otherwise restricted by
copyright and certain other rights. Our licenses are
irrevocable. Licensors should read and understand the terms
and conditions of the license they choose before applying it.
Licensors should also secure all rights necessary before
applying our licenses so that the public can reuse the
material as expected. Licensors should clearly mark any
material not subject to the license. This includes other CC-
licensed material, or material used under an exception or
limitation to copyright. More considerations for licensors:
wiki.creativecommons.org/Considerations_for_licensors
Considerations for the public: By using one of our public
licenses, a licensor grants the public permission to use the
licensed material under specified terms and conditions. If
the licensor's permission is not necessary for any reason--for
example, because of any applicable exception or limitation to
copyright--then that use is not regulated by the license. Our
licenses grant only permissions under copyright and certain
other rights that a licensor has authority to grant. Use of
the licensed material may still be restricted for other
reasons, including because others have copyright or other
rights in the material. A licensor may make special requests,
such as asking that all changes be marked or described.
Although not required by our licenses, you are encouraged to
respect those requests where reasonable. More considerations
for the public:
wiki.creativecommons.org/Considerations_for_licensees
=======================================================================
Creative Commons Attribution-ShareAlike 4.0 International Public
License
By exercising the Licensed Rights (defined below), You accept and agree
to be bound by the terms and conditions of this Creative Commons
Attribution-ShareAlike 4.0 International Public License ("Public
License"). To the extent this Public License may be interpreted as a
contract, You are granted the Licensed Rights in consideration of Your
acceptance of these terms and conditions, and the Licensor grants You
such rights in consideration of benefits the Licensor receives from
making the Licensed Material available under these terms and
conditions.
Section 1 -- Definitions.
a. Adapted Material means material subject to Copyright and Similar
Rights that is derived from or based upon the Licensed Material
and in which the Licensed Material is translated, altered,
arranged, transformed, or otherwise modified in a manner requiring
permission under the Copyright and Similar Rights held by the
Licensor. For purposes of this Public License, where the Licensed
Material is a musical work, performance, or sound recording,
Adapted Material is always produced where the Licensed Material is
synched in timed relation with a moving image.
b. Adapter's License means the license You apply to Your Copyright
and Similar Rights in Your contributions to Adapted Material in
accordance with the terms and conditions of this Public License.
c. BY-SA Compatible License means a license listed at
creativecommons.org/compatiblelicenses, approved by Creative
Commons as essentially the equivalent of this Public License.
d. Copyright and Similar Rights means copyright and/or similar rights
closely related to copyright including, without limitation,
performance, broadcast, sound recording, and Sui Generis Database
Rights, without regard to how the rights are labeled or
categorized. For purposes of this Public License, the rights
specified in Section 2(b)(1)-(2) are not Copyright and Similar
Rights.
e. Effective Technological Measures means those measures that, in the
absence of proper authority, may not be circumvented under laws
fulfilling obligations under Article 11 of the WIPO Copyright
Treaty adopted on December 20, 1996, and/or similar international
agreements.
f. Exceptions and Limitations means fair use, fair dealing, and/or
any other exception or limitation to Copyright and Similar Rights
that applies to Your use of the Licensed Material.
g. License Elements means the license attributes listed in the name
of a Creative Commons Public License. The License Elements of this
Public License are Attribution and ShareAlike.
h. Licensed Material means the artistic or literary work, database,
or other material to which the Licensor applied this Public
License.
i. Licensed Rights means the rights granted to You subject to the
terms and conditions of this Public License, which are limited to
all Copyright and Similar Rights that apply to Your use of the
Licensed Material and that the Licensor has authority to license.
j. Licensor means the individual(s) or entity(ies) granting rights
under this Public License.
k. Share means to provide material to the public by any means or
process that requires permission under the Licensed Rights, such
as reproduction, public display, public performance, distribution,
dissemination, communication, or importation, and to make material
available to the public including in ways that members of the
public may access the material from a place and at a time
individually chosen by them.
l. Sui Generis Database Rights means rights other than copyright
resulting from Directive 96/9/EC of the European Parliament and of
the Council of 11 March 1996 on the legal protection of databases,
as amended and/or succeeded, as well as other essentially
equivalent rights anywhere in the world.
m. You means the individual or entity exercising the Licensed Rights
under this Public License. Your has a corresponding meaning.
Section 2 -- Scope.
a. License grant.
1. Subject to the terms and conditions of this Public License,
the Licensor hereby grants You a worldwide, royalty-free,
non-sublicensable, non-exclusive, irrevocable license to
exercise the Licensed Rights in the Licensed Material to:
a. reproduce and Share the Licensed Material, in whole or
in part; and
b. produce, reproduce, and Share Adapted Material.
2. Exceptions and Limitations. For the avoidance of doubt, where
Exceptions and Limitations apply to Your use, this Public
License does not apply, and You do not need to comply with
its terms and conditions.
3. Term. The term of this Public License is specified in Section
6(a).
4. Media and formats; technical modifications allowed. The
Licensor authorizes You to exercise the Licensed Rights in
all media and formats whether now known or hereafter created,
and to make technical modifications necessary to do so. The
Licensor waives and/or agrees not to assert any right or
authority to forbid You from making technical modifications
necessary to exercise the Licensed Rights, including
technical modifications necessary to circumvent Effective
Technological Measures. For purposes of this Public License,
simply making modifications authorized by this Section 2(a)
(4) never produces Adapted Material.
5. Downstream recipients.
a. Offer from the Licensor -- Licensed Material. Every
recipient of the Licensed Material automatically
receives an offer from the Licensor to exercise the
Licensed Rights under the terms and conditions of this
Public License.
b. Additional offer from the Licensor -- Adapted Material.
Every recipient of Adapted Material from You
automatically receives an offer from the Licensor to
exercise the Licensed Rights in the Adapted Material
under the conditions of the Adapter's License You apply.
c. No downstream restrictions. You may not offer or impose
any additional or different terms or conditions on, or
apply any Effective Technological Measures to, the
Licensed Material if doing so restricts exercise of the
Licensed Rights by any recipient of the Licensed
Material.
6. No endorsement. Nothing in this Public License constitutes or
may be construed as permission to assert or imply that You
are, or that Your use of the Licensed Material is, connected
with, or sponsored, endorsed, or granted official status by,
the Licensor or others designated to receive attribution as
provided in Section 3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not
licensed under this Public License, nor are publicity,
privacy, and/or other similar personality rights; however, to
the extent possible, the Licensor waives and/or agrees not to
assert any such rights held by the Licensor to the limited
extent necessary to allow You to exercise the Licensed
Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this
Public License.
3. To the extent possible, the Licensor waives any right to
collect royalties from You for the exercise of the Licensed
Rights, whether directly or through a collecting society
under any voluntary or waivable statutory or compulsory
licensing scheme. In all other cases the Licensor expressly
reserves any right to collect such royalties.
Section 3 -- License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the
following conditions.
a. Attribution.
1. If You Share the Licensed Material (including in modified
form), You must:
a. retain the following if it is supplied by the Licensor
with the Licensed Material:
i. identification of the creator(s) of the Licensed
Material and any others designated to receive
attribution, in any reasonable manner requested by
the Licensor (including by pseudonym if
designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of
warranties;
v. a URI or hyperlink to the Licensed Material to the
extent reasonably practicable;
b. indicate if You modified the Licensed Material and
retain an indication of any previous modifications; and
c. indicate the Licensed Material is licensed under this
Public License, and include the text of, or the URI or
hyperlink to, this Public License.
2. You may satisfy the conditions in Section 3(a)(1) in any
reasonable manner based on the medium, means, and context in
which You Share the Licensed Material. For example, it may be
reasonable to satisfy the conditions by providing a URI or
hyperlink to a resource that includes the required
information.
3. If requested by the Licensor, You must remove any of the
information required by Section 3(a)(1)(A) to the extent
reasonably practicable.
b. ShareAlike.
In addition to the conditions in Section 3(a), if You Share
Adapted Material You produce, the following conditions also apply.
1. The Adapter's License You apply must be a Creative Commons
license with the same License Elements, this version or
later, or a BY-SA Compatible License.
2. You must include the text of, or the URI or hyperlink to, the
Adapter's License You apply. You may satisfy this condition
in any reasonable manner based on the medium, means, and
context in which You Share Adapted Material.
3. You may not offer or impose any additional or different terms
or conditions on, or apply any Effective Technological
Measures to, Adapted Material that restrict exercise of the
rights granted under the Adapter's License You apply.
Section 4 -- Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that
apply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
to extract, reuse, reproduce, and Share all or a substantial
portion of the contents of the database;
b. if You include all or a substantial portion of the database
contents in a database in which You have Sui Generis Database
Rights, then the database in which You have Sui Generis Database
Rights (but not its individual contents) is Adapted Material,
including for purposes of Section 3(b); and
c. You must comply with the conditions in Section 3(a) if You Share
all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not
replace Your obligations under this Public License where the Licensed
Rights include other Copyright and Similar Rights.
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
c. The disclaimer of warranties and limitation of liability provided
above shall be interpreted in a manner that, to the extent
possible, most closely approximates an absolute disclaimer and
waiver of all liability.
Section 6 -- Term and Termination.
a. This Public License applies for the term of the Copyright and
Similar Rights licensed here. However, if You fail to comply with
this Public License, then Your rights under this Public License
terminate automatically.
b. Where Your right to use the Licensed Material has terminated under
Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided
it is cured within 30 days of Your discovery of the
violation; or
2. upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any
right the Licensor may have to seek remedies for Your violations
of this Public License.
c. For the avoidance of doubt, the Licensor may also offer the
Licensed Material under separate terms or conditions or stop
distributing the Licensed Material at any time; however, doing so
will not terminate this Public License.
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
License.
Section 7 -- Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different
terms or conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the
Licensed Material not stated herein are separate from and
independent of the terms and conditions of this Public License.
Section 8 -- Interpretation.
a. For the avoidance of doubt, this Public License does not, and
shall not be interpreted to, reduce, limit, restrict, or impose
conditions on any use of the Licensed Material that could lawfully
be made without permission under this Public License.
b. To the extent possible, if any provision of this Public License is
deemed unenforceable, it shall be automatically reformed to the
minimum extent necessary to make it enforceable. If the provision
cannot be reformed, it shall be severed from this Public License
without affecting the enforceability of the remaining terms and
conditions.
c. No term or condition of this Public License will be waived and no
failure to comply consented to unless expressly agreed to by the
Licensor.
d. Nothing in this Public License constitutes or may be interpreted
as a limitation upon, or waiver of, any privileges and immunities
that apply to the Licensor or You, including from the legal
processes of any jurisdiction or authority.
=======================================================================
Creative Commons is not a party to its public
licenses. Notwithstanding, Creative Commons may elect to apply one of
its public licenses to material it publishes and in those instances
will be considered the “Licensor.” The text of the Creative Commons
public licenses is dedicated to the public domain under the CC0 Public
Domain Dedication. Except for the limited purpose of indicating that
material is shared under a Creative Commons public license or as
otherwise permitted by the Creative Commons policies published at
creativecommons.org/policies, Creative Commons does not authorize the
use of the trademark "Creative Commons" or any other trademark or logo
of Creative Commons without its prior written consent including,
without limitation, in connection with any unauthorized modifications
to any of its public licenses or any other arrangements,
understandings, or agreements concerning use of licensed material. For
the avoidance of doubt, this paragraph does not form part of the
public licenses.
Creative Commons may be contacted at creativecommons.org.

View File

@@ -0,0 +1,15 @@
# MITM 域前置
ray 很久很久就支持 MITM, 这个功能一直被雪藏,所以还是决定对代码小修改之后放出模板。
这是个仅客户端模板,作用是对请求进行 MITM 解密 TLS 后重新以假 SNI 发出 TLS 请求,达到强行域前置的目的。这只是一个演示其作用机制的模板,它的作用也不止于此,你单纯用来进行 TLS 卸载供后续程序处理或者把明文数据加密进 TLS 隧道什么的也是一种用法。
使用前请确保你足够了解 TLS 和 HTTPS 协议.(至少需要知道 SNI 和 alpn 的工作机制)
这里的接入方法选择了手动使用 socks5 代理,实际上 socks5 代理只是个把请求劫持到本地任意门入站的方法,实际上你可以用 hosts 或者任何方法把请求劫持到 tag 为 tls-decrypt 的那个入站,都可以满足需求。
**请仔细阅读我留下的每一行注释**,有助于你理解工作原理和正确部署。
这个东西能工作的前提是该网站**接受域前置或无 SNI 请求,且有 IP 没有被墙**,你可能需要靠扫描或者社区收集寻找这样可用的 SNI 和 IP 集。
演示网站我选择了 e-hentai, 主要因为它的前端结构比较简单,只要处理了这个域名别的资源都可以正常加载,其他网站可能还需要处理一些资源域名。

View File

@@ -0,0 +1,133 @@
{
"log": {
"loglevel": "debug"
},
"inbounds": [
// 请求在该入站中被解密
{
"port": 4431,
"listen": "127.0.0.1",
"tag": "tls-decrypt",
"protocol": "dokodemo-door",
"settings": {
"network": "tcp",
// 从 TLS 的 SNI 中读出目标地址并应用至请求,用于后续路由
"followRedirect": true
},
"streamSettings": {
"security": "tls",
"tlsSettings": {
// 根据实际情况填写,这里适合绝大多数情况,如果你的网站仅支持 http/1.1, 就只保留 http/1.1
// ps: 如果你选择了 http/1.1 那么你甚至可以用后续的路由模块屏蔽部分路径
"alpn": [
"h2",
"http/1.1"
],
"certificates": [
{
"usage": "issue",
"buildChain": "true",
// 下面的证书和私钥使用 xray tls cert -ca 命令生成,或者你的自签名证书也行
// 这会生成一个 CA 证书,每个新的要被 MITM 网站请求都会单独用这个 CA 签发一张临时证书
// 所以你只需要在系统信任这一张证书就可以了,或者你可以忍得了浏览器的红标无视风险继续访问也行
"certificate": [],
"key": []
}
]
}
}
},
// 真正用到的入站
{
"port": 10801,
"listen": "127.0.0.1",
"tag": "socks-in",
"protocol": "socks",
"sniffing": {
// 一般情况得开
"enabled": true,
"destOverride": [
"http",
"tls"
]
}
}
],
"outbounds": [
// 请求在该出站被强行重定向到 tls-decrypt 进行解密
{
"tag": "redirect-out",
"protocol": "freedom",
"settings": {
"redirect": "127.0.0.1:4431"
}
},
// 明文请求在这里被重新加密为正常 HTTPS 请求
{
"tag": "tls-repack",
"protocol": "freedom",
"settings": {
// 你要连接到的服务器的最终IP以及端口大多数情况下需要手动寻找这样允许域前置的IP
"redirect": "104.20.19.168:443"
},
"streamSettings": {
"security": "tls",
"tlsSettings": {
// fromMitm 会在客户端发送仅有 alpn http/1.1(大多数时候是wss) 的情况下使用同样的alpn, 需要 v25.2.21+
// 旧版本没这个选项别直接把这玩意发出去了从上面的alpn选项复制下来(当然更新版本最好)
"alpn": [
"fromMitm"
],
// 你要发送的假 SNI, 根据你的网站接受的 SNI 而定
// 当然你也可以留空或者我这样乱填个ip, 这样就不会有任何 SNI 扩展被发送,前提是你的网站接受无 SNI 请求
"serverName": "11.45.1.4",
// 你期望服务端返回证书里的包含的域名,需要 v25.2.21+
// 如果是旧版本只能考虑开允许不安全,然后可以考虑文档中其他校验证书的方法进行验证
"verifyPeerCertInNames": [
"e-hentai.org",
// 特殊选项,尝试按从 dokodemo-door 入站进来的 SNI 对远端证书进行验证(或取自内置 DNS 的 DoH h2c hostname
"fromMitm"
]
}
}
},
// 无辜流量直接放行
{
"tag": "direct",
"protocol": "freedom"
}
],
"routing": {
"domainStrategy": "AsIs",
"rules": [
{
"inboundTag": [
"tls-decrypt"
],
// tls-repark 中定义了一些参数(比如IP和SNI), 不同的网站可能需要不同的参数
// 要支持更多的网站,可以新建更多的此类 freedom 出站,然后在这里把不同的明文请求按需求路由到不同的出站重新打包回 HTTPS
// 这里的域名来源就是 tls-decrypt 入站的 followRedirect, 所以一个本地端口就可以接受任何网站的请求并在核心中这样区分开
"domain": [
"e-hentai.org"
],
"outboundTag": "tls-repack"
},
{
"inboundTag": [
"socks-in"
],
// 你要 mitm 的网址
"domain": [
"e-hentai.org"
],
"outboundTag": "redirect-out"
},
{
"inboundTag": [
"socks-in"
],
"outboundTag": "direct"
}
]
}
}

View File

@@ -1,3 +1,3 @@
# Xray-examples
Forked from [v2ray-examples](https://github.com/v2fly/v2ray-examples)
Some examples of uses for [Xray-core](https://github.com/XTLS/Xray-core)

View File

@@ -0,0 +1,21 @@
# reverse proxy
# principle
Xray Client <--- VMESS/SS ---> Xray Portal (requires public IP) <--- VMESS/SS ---> Xray Bridge
# illustrate
In the configuration, the internal network device uses `bridge.json`, the device with public network ip uses `portal.json`, and the device connected to the intranet through `portal` uses `client.json`.
In practical applications, `VMESS-TCP, Shadowsocks-2022`, etc. can be used as the transmission protocols from Xray Client to Xray Portal, and from Xray Bridge to Xray Portal.
## psk
Shadowsocks 2022 uses a pre-shared key similar to WireGuard for the password.
Use `openssl rand -base64 <length>` to generate a shadowsocks-rust compatible key, the length depends on the encryption method used.
| encryption method | key length |
|--------------------------------|-----:|
| 2022-blake3-aes-128-gcm | 16 |
| 2022-blake3-aes-256-gcm | 32 |
| 2022-blake3-chacha20-poly1305 | 32 |
In the Go implementation, 32-bit keys always work.

View File

@@ -1,5 +1,8 @@
[ENGLISH](README.ENG.md)
# 反向代理
# 原理
Xray Client <--- VMESS/SS ---> Xray Portal(需要公网 IP) <--- VMESS/SS ---> Xray Bridge
# 说明
配置中,内网设备使用的配置为 `bridge.json`,有公网 ip 的设备使用 `portal.json`,通过`portal`连接到内网的设备使用`client.json`
@@ -18,4 +21,4 @@ Shadowsocks 2022 使用与 WireGuard 类似的预共享密钥作为密码。
| 2022-blake3-aes-256-gcm | 32 |
| 2022-blake3-chacha20-poly1305 | 32 |
在 Go 实现中32 位密钥始终工作。
在 Go 实现中32 位密钥始终工作。

View File

@@ -0,0 +1,20 @@
# VLESS over TCP with XTLS + fallback & split
Cooperate with fallback, use port 443 + XTLS + WS and route diversion to realize reverse proxy and enhance concealment.
There are two client connection methods: VLESS over WS with TLS / VLESS over TCP with XTLS
The portal setting defaults to the web server on port 80 (it can also be replaced with a database, FTP, etc.), refer to [VLESS-TCP-XTLS-WHATEVER](https://github.com/XTLS/Xray-examples/blob/main/VLESS-TCP-XTLS-WHATEVER/README.md)
# additional configuration
If your portal is outside the country, you can use routing splitting to achieve scientific Internet access + access to intranet devices at the same time.
## Routing split
According to the prompt in the configuration, in the `Portal` configuration, uncomment the first route:
```
// "ip": [
// "geoip:private"
// ],
```
At this time, when the traffic matches the `"external"` or `"externalws"` label, and the target ip of the access is a `private ip address`, the traffic will be forwarded to the bridge, and the rest of the traffic will go direct.

View File

@@ -1,5 +1,7 @@
# VLESS over TCP with XTLS + 回落 & 分流
[ENGLISH](README.ENG.md)
配合回落,使用 443 端口 + XTLS + WS 和路由分流,实现反向代理,增强隐蔽性。
客户端连接方式有 VLESS over WS with TLS / VLESS over TCP with XTLS 两种

View File

@@ -41,7 +41,7 @@
"users": [
{
"id": "", // UUID
"flow": "xtls-rprx-direct",
"flow": "xtls-rprx-vision",
"encryption": "none",
"level": 0
}
@@ -51,8 +51,8 @@
},
"streamSettings": {
"network": "tcp",
"security": "xtls",
"xtlsSettings": {
"security": "tls",
"tlsSettings": {
"serverName": "reverse.example" //
}
}

View File

@@ -19,7 +19,7 @@
"clients": [
{
"id": "", // UUID
"flow": "xtls-rprx-direct",
"flow": "xtls-rprx-vsion",
"level": 0,
"email": "@external"
}
@@ -43,8 +43,8 @@
},
"streamSettings": {
"network": "tcp",
"security": "xtls",
"xtlsSettings": {
"security": "tls",
"tlsSettings": {
"alpn": [
"http/1.1"
],

View File

@@ -0,0 +1,48 @@
# Access almost all websites & services directly, for every person in Iran
**Configs here can not contain "bypassing sanctions" contents (inappropriate on US GitHub)**
**Please join the official Xray Iranian group https://t.me/projectXhttp to get the whole working configs**
# Serverless for Iran
Bypass censorship using TCP/TLS fragment and UDP noises.
It doesn't change your local IP, so it is not suitable for anonymity.
# Serverless with MitM-Domain-Fronting for Iran (Xray-core v25.9.5+)
Same as "Serverless for Iran" but use "DoH h2c + domain fronting" for DNS and MitM for these services that support domain fronting:
* YouTube
* X
* Reddit
* Meta (Facebook, Instagram, ...)
(This list will be updated)
**Requires a self-signed-certificate: You can create it using "./xray tls cert -ca -file=mycert" command.**
**Also, the certificate must be imported into "Trusted-Root-Certification-Authorities" of system/browser.**
## How to import the certificate into the system/browser:
**Windows**:
* System:
Right click on the certificate -> Install certificate -> Local machine -> Place all certificates in the following store -> Select "Trusted Root Certification Authorities"
* Browser(Chrome):
Settings -> Privacy and security -> Security -> Manage certificates -> Manage imported certificates from Windows -> Trusted Root Certification Authorities -> Import -> Select the certificate file -> Place all certificates in the following store -> Select "Trusted Root Certification Authorities"
**Android**:
* Chromium based browsers and Apps that support user-certificates:
Setting -> Security and privacy -> More security settings -> Install from device storage -> CA Certificate -> Install anyway -> Select the Certificate file on your storage.
* Firefox:
Run the firefox browser -> Settings -> About Firefox -> Tap the Firefox logo five times -> Navigate to Settings -> Secret Settings -> Toggle "Use third party CA certificates"

View File

@@ -0,0 +1,272 @@
// Configs here can not contain "bypassing sanctions" contents (inappropriate on US GitHub)
// Please join the official Xray Iranian group https://t.me/projectXhttp to get the whole working configs
{
"remarks": "Serverless",
"version": {
"min": "25.9.5"
},
"log": {
"loglevel": "warning", "dnsLog": false, "access": "none"
},
"policy": {
"levels": {
"0": {
"uplinkOnly": 0,
"downlinkOnly": 0
}
}
},
"dns":{
"hosts": {
"geosite:category-ads-all": "#3",
"one.one.one.one": ["1.1.1.1", "1.0.0.1", "2606:4700:4700::1111", "2606:4700:4700::1001"],
"cloudflare-dns.com": "www.cloudflare.com"
},
"servers": [
{
"address": "fakedns",
"domains": ["domain:ir", "geosite:private", "geosite:category-ir", "full:www.cloudflare.com"],
"finalQuery": true
},
{
"tag": "no-filter-dns",
"address": "https://cloudflare-dns.com/dns-query",
"timeoutMs": 5000,
"finalQuery": true
},
{
"address": "localhost",
"domains": ["domain:ir", "geosite:private", "geosite:category-ir", "full:www.cloudflare.com"],
"finalQuery": true
}
],
"queryStrategy": "UseSystem",
"useSystemHosts": true
},
"inbounds": [
{
"tag": "dns-in",
"listen": "127.0.0.1",
"port": 10853,
"protocol": "tunnel",
"settings": {
"address": "one.one.one.one",
"port": 53,
"network": "tcp,udp"
},
"streamSettings": {
"sockopt": {
"tcpKeepAliveInterval": 1,
"tcpKeepAliveIdle": 46
}
}
},
{
"tag": "socks-in",
"listen": "127.0.0.1",
"port": 10808,
"protocol": "mixed",
"sniffing": {
"enabled": true,
"destOverride": ["fakedns"],
"routeOnly": false
},
"settings": {
"udp": true,
"ip": "127.0.0.1"
},
"streamSettings": {
"sockopt": {
"tcpKeepAliveInterval": 1,
"tcpKeepAliveIdle": 46
}
}
}
],
"outbounds": [
{
"tag": "block-out",
"protocol": "block"
},
{
"tag": "direct-out",
"protocol": "direct",
"streamSettings": {
"sockopt": {
"domainStrategy": "ForceIP",
"happyEyeballs": {
"tryDelayMs": 100,
"prioritizeIPv6": true,
"interleave": 2,
"maxConcurrentTry": 16
}
}
}
},
{
"tag": "dns-out",
"protocol": "dns",
"settings": {"nonIPQuery": "skip", "network": "tcp", "address": "one.one.one.one", "port": 53},
"streamSettings": {
"sockopt": {
"dialerProxy": "full-fragment"
}
}
},
{
"tag": "skip-fragment",
"protocol": "direct",
"settings": {
"fragment": {
"packets": "1-1",
"length": "130",
"interval": "190",
"maxSplit": "4"
}
},
"streamSettings": {
"sockopt": {
"dialerProxy": "_chain-skip"
}
}
},
{
"tag": "_chain-skip",
"protocol": "direct",
"settings": {
"fragment": {
"packets": "2-4",
"length": "1",
"interval": "1",
"maxSplit": "130"
}
},
"streamSettings": {
"sockopt": {
"domainStrategy": "ForceIP",
"happyEyeballs": {
"tryDelayMs": 300,
"prioritizeIPv6": true,
"interleave": 2,
"maxConcurrentTry": 16
}
}
}
},
{
"tag": "full-fragment",
"protocol": "direct",
"settings": {
"fragment": {
"packets": "1-1",
"length": "1",
"interval": "1",
"maxSplit": "517"
}
},
"streamSettings": {
"sockopt": {
"domainStrategy": "ForceIP",
"happyEyeballs": {
"tryDelayMs": 300,
"prioritizeIPv6": true,
"interleave": 2,
"maxConcurrentTry": 16
}
}
}
},
{
"tag": "udp-noises",
"protocol": "direct",
"settings": {
"targetStrategy": "ForceIP", // or "ForceIPv6v4" to prefer IPv6
"noises": [
{"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
{"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
{"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
{"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
{"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
{"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
{"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
{"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
{"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
{"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
{"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
{"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"}, {"type": "rand", "packet": "1250", "delay": "10", "applyTo": "ipv4"},
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"},
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"},
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"},
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"},
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"},
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"},
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"},
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"},
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"},
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"},
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"},
{"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}, {"type": "rand", "packet": "1230", "delay": "10", "applyTo": "ipv6"}
]
}
}
],
"routing": {
"domainStrategy": "IPOnDemand",
"rules": [
{"outboundTag": "block-out",
"domain": ["geosite:category-ads-all"]
},
{"outboundTag": "dns-out",
"inboundTag": ["dns-in"]
},
{"outboundTag": "dns-out",
"inboundTag": ["socks-in"], "port": 53
},
{"outboundTag": "full-fragment", // or "skip-fragment"
"inboundTag": ["no-filter-dns"]
},
{"outboundTag": "block-out",
"ip": ["0.0.0.0", "::"]
},
{"outboundTag": "direct-out",
"domain": ["domain:ir", "geosite:private", "geosite:category-ir"]
},
{"outboundTag": "direct-out",
"ip": ["geoip:private", "geoip:ir"]
},
{"outboundTag": "udp-noises",
"network": "udp", "protocol": ["quic"]
},
{"outboundTag": "udp-noises",
"network": "udp", "port": "443,2053,2083,2087,2096,8443"
},
{"outboundTag": "direct-out",
"network": "udp"
},
{"outboundTag": "full-fragment", // or "skip-fragment"
"network": "tcp", "protocol": ["tls"]
},
{"outboundTag": "full-fragment", // or "skip-fragment"
"network": "tcp", "port": "443,2053,2083,2087,2096,8443"
},
{"outboundTag": "full-fragment",
"network": "tcp", "protocol": ["http"]
},
{"outboundTag": "full-fragment",
"network": "tcp", "port": "80,8080,8880,2052,2082,2086,2095"
},
{"outboundTag": "full-fragment",
"network": "tcp"
}
]
}
}

View File

@@ -0,0 +1,347 @@
// Configs here can not contain "bypassing sanctions" contents (inappropriate on US GitHub)
// Please join the official Xray Iranian group https://t.me/projectXhttp to get the whole working configs
// Serverless with MitM-Domain-Fronting for Iran v4
// Xray-core v25.2.21+
// Requires a self-signed-certificate: You can create it using "./xray tls cert -ca -file=mycert" command.
// Also, the certificate must be imported into "Trusted-Root-Certification-Authorities" of system/browser.
{
"log": {
"loglevel": "warning", "dnsLog": false, "access": "none"
},
"dns":{
"hosts": {
"geosite:category-ads-all": ["10.10.34.36", "2001:4188:2:600:10:10:34:36"]
},
"servers": [
"h2c://1.1.1.1/dns-query",
{"address": "localhost", "domains": ["geosite:private", "geosite:category-ir"]}
],
"tag": "dns-query",
"disableFallback": true
},
"inbounds": [
{
"tag": "dns-in",
"port": 10853,
"protocol": "dokodemo-door",
"settings": {
"address": "1.1.1.1",
"port": 53,
"network": "tcp,udp"
}
},
{
"tag": "socks-in",
"port": 10808,
"protocol": "socks",
"sniffing": {
"enabled": true,
"destOverride": ["http", "tls"],
"routeOnly": false
},
"settings": {"udp": true}
},
{
"port": 4431,
"tag": "tls-decrypt-h11",
"protocol": "dokodemo-door",
"settings": {
"network": "tcp",
"port": 443,
"followRedirect": true
},
"streamSettings": {
"security": "tls",
"tlsSettings": {
"alpn": ["http/1.1"],
"certificates": [
{
"usage": "issue",
"certificateFile": "mycert.crt", // certificate path
"keyFile": "mycert.key" // private-key path
}
]
}
}
},
{
"port": 4432,
"tag": "tls-decrypt-h211",
"protocol": "dokodemo-door",
"settings": {
"network": "tcp",
"port": 443,
"followRedirect": true
},
"streamSettings": {
"security": "tls",
"tlsSettings": {
"alpn": ["h2","http/1.1"],
"certificates": [
{
"usage": "issue",
"certificateFile": "mycert.crt", // certificate path
"keyFile": "mycert.key" // private-key path
}
]
}
}
}
],
"outbounds": [
{
"tag": "block",
"protocol": "blackhole"
},
{
"tag": "direct",
"protocol": "freedom",
"settings": {"domainStrategy": "ForceIP"}
},
{
"tag": "redirect-out-h11",
"protocol": "freedom",
"settings": {
"redirect": "127.0.0.1:4431"
}
},
{
"tag": "redirect-out-h211",
"protocol": "freedom",
"settings": {
"redirect": "127.0.0.1:4432"
}
},
{
"tag": "tls-repack-dns",
"protocol": "freedom",
"settings": {"domainStrategy": "ForceIP"},
"streamSettings": {
"security": "tls",
"tlsSettings": {
"serverName": "www.microsoft.com",
"verifyPeerCertInNames": ["fromMitM", "www.microsoft.com"],
"alpn": ["fromMitM"],
"fingerprint": "chrome"
}
}
},
{
"tag": "tls-repack-google",
"protocol": "freedom",
"settings": {"domainStrategy": "ForceIP"},
"streamSettings": {
"security": "tls",
"tlsSettings": {
"serverName": "www.google.com",
"verifyPeerCertInNames": ["fromMitM", "www.google.com", "dns.google", "www.googlevideo.com", "www.youtube.com"],
"alpn": ["fromMitM"],
"fingerprint": "chrome"
}
}
},
{
"tag": "tls-repack-meta",
"protocol": "freedom",
"settings": {"domainStrategy": "ForceIP"},
"streamSettings": {
"security": "tls",
"tlsSettings": {
"serverName": "www.whatsapp.com",
"verifyPeerCertInNames": ["fromMitM", "www.whatsapp.com", "www.facebook.com", "www.ar.meta.com", "www.fb.com", "www.whatsapp.net", "www.atlassolutions.com", "www.secure.facebook.com", "www.extern.facebook.com", "www.internet.org", "www.oculus.com", "www.wit.ai", "www.facebook-dns.com", "www.instagram.com", "www.meta.com", "www.external-disputes.meta.com", "www.fbe2e.com", "www.cloud.x2p.facebook.net", "www.secure.latest.facebook.com"],
"alpn": ["fromMitM"],
"fingerprint": "chrome"
}
}
},
{
"tag": "tls-repack-fastly",
"protocol": "freedom",
"settings": {"domainStrategy": "ForceIP"},
"streamSettings": {
"security": "tls",
"tlsSettings": {
"serverName": "www.fastly.com",
"verifyPeerCertInNames": ["fromMitM", "www.fastly.com", "www.reddit.com", "x.com"],
"alpn": ["fromMitM"],
"fingerprint": "chrome"
}
}
},
{
"tag": "dns-out",
"protocol": "dns",
"settings": {"nonIPQuery": "skip", "network": "tcp", "address": "1.1.1.1", "port": 53},
"streamSettings": {
"sockopt": {
"dialerProxy": "chain1-fragment"
}
}
},
{
"tag": "super-fragment",
"protocol": "freedom",
"settings": {
"fragment": {
"packets": "tlshello",
"length": "6",
"interval": "0"
}
},
"streamSettings": {
"sockopt": {
"dialerProxy": "chain1-fragment"
}
}
},
{
"tag": "chain1-fragment",
"protocol": "freedom",
"settings": {
"fragment": {
"packets": "1-3",
"length": "517",
"interval": "1"
}
},
"streamSettings": {
"sockopt": {
"dialerProxy": "chain2-fragment"
}
}
},
{
"tag": "chain2-fragment",
"protocol": "freedom",
"settings": {
"domainStrategy": "ForceIP",
"fragment": {
"packets": "1-1",
"length": "1",
"interval": "2"
}
}
},
{
"tag": "udp-noisesv4",
"protocol": "freedom",
"settings": {
"domainStrategy": "ForceIPv4",
"noises": [
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"},
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"},
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"},
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"},
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"},
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"},
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"},
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"},
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"},
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"},
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"},
{"type": "rand", "packet": "1250", "delay": "10"}, {"type": "rand", "packet": "1250", "delay": "10"}
]
}
},
{
"tag": "udp-noisesv6",
"protocol": "freedom",
"settings": {
"domainStrategy": "ForceIPv6",
"noises": [
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"},
{"type": "rand", "packet": "1230", "delay": "10"}, {"type": "rand", "packet": "1230", "delay": "10"}
]
}
}
],
"routing": {
"domainStrategy": "IPOnDemand",
"rules": [
{"outboundTag": "dns-out",
"inboundTag": ["dns-in"]
},
{"outboundTag": "dns-out",
"inboundTag": ["socks-in"], "port": 53
},
{"outboundTag": "tls-repack-dns",
"inboundTag": ["dns-query"]
},
{"outboundTag": "block",
"domain": ["geosite:category-ads-all"]
},
{"outboundTag": "block",
"ip": ["10.10.34.0/24", "2001:4188:2:600:10:10:34:36", "2001:4188:2:600:10:10:34:35", "2001:4188:2:600:10:10:34:34"]
},
{"outboundTag": "direct",
"domain": ["geosite:private", "geosite:category-ir"]
},
{"outboundTag": "direct",
"ip": ["geoip:private", "geoip:ir"]
},
{"outboundTag": "chain1-fragment", // or "super-fragment"
"inboundTag": ["socks-in"],
"network": "tcp",
"ip": ["geoip:cloudflare", "geoip:cloudfront"]
},
{
"outboundTag": "redirect-out-h11",
"inboundTag": ["socks-in"],
"network": "tcp",
"protocol": ["tls"],
"port": 443,
"domain": ["domain:googlevideo.com"]
},
{
"outboundTag": "redirect-out-h211",
"inboundTag": ["socks-in"],
"network": "tcp",
"protocol": ["tls"],
"port": 443,
"domain": ["geosite:youtube", "geosite:x", "geosite:reddit", "geosite:meta"]
},
{"outboundTag": "tls-repack-google",
"domain": ["geosite:youtube", "domain:googlevideo.com"],
"inboundTag": ["tls-decrypt-h11", "tls-decrypt-h211"]
},
{"outboundTag": "tls-repack-meta",
"domain": ["geosite:meta"],
"inboundTag": ["tls-decrypt-h11", "tls-decrypt-h211"]
},
{"outboundTag": "tls-repack-fastly",
"domain": ["geosite:x", "geosite:reddit"],
"inboundTag": ["tls-decrypt-h11", "tls-decrypt-h211"]
},
{"outboundTag": "udp-noisesv4",
"network": "udp", "ip": ["0.0.0.0/0"], "port": 443
},
{"outboundTag": "udp-noisesv6",
"network": "udp", "ip": ["::/0"], "port": 443
},
{"outboundTag": "direct",
"network": "udp"
},
{"outboundTag": "chain1-fragment", // or "super-fragment"
"network": "tcp"
}
]
}
}

View File

@@ -0,0 +1,239 @@
#Shadowsocks2022
Server-side JSON
```json
{
"inbounds": [
{
"port": 1234,
"protocol": "shadowsocks",
"settings": {
"method": "2022-blake3-aes-128-gcm",
"password": "{{ psk }}",
"network": "tcp,udp"
}
}
],
"outbounds": [
{
"protocol": "freedom"
}
]
}
```
Server-side JSON (multi-user)
```json
{
"inbounds": [
{
"port": 1234,
"protocol": "shadowsocks",
"settings": {
"method": "2022-blake3-aes-128-gcm",
"password": "{{ server psk }}",
"clients": [
{
"password": "{{ user psk }}",
"email": "my user"
}
],
"network": "tcp,udp"
}
}
],
"outbounds": [
{
"protocol": "freedom"
}
]
}
```
Server-side JSON (transit)
```json
{
"inbounds": [
{
"port": 1234,
"protocol": "shadowsocks",
"settings": {
"method": "2022-blake3-aes-128-gcm",
"password": "{{ relay psk }}",
"clients": [
{
"address": "server",
"port": 1234,
"password": "{{ server/user psk }}",
"email": "my server"
}
],
"network": "tcp,udp"
}
}
],
"outbounds": [
{
"protocol": "freedom"
}
]
}
```
Client JSON
```json
{
"inbounds": [
{
"port": 10801,
"protocol": "socks",
"settings": {
"udp": true
}
},
{
"port": 10802,
"protocol": "http"
}
],
"outbounds": [
{
"protocol": "shadowsocks",
"settings": {
"servers": [
{
"address": "{{ host }}",
"port": 1234,
"method": "2022-blake3-aes-128-gcm",
"password": "{{ psk }}"
}
]
}
}
]
}
```
Client JSON (UDP over TCP)
```json
{
"inbounds": [
{
"port": 10801,
"protocol": "socks",
"settings": {
"udp": true
}
},
{
"port": 10802,
"protocol": "http"
}
],
"outbounds": [
{
"protocol": "shadowsocks",
"settings": {
"servers": [
{
"address": "{{ host }}",
"port": 1234,
"method": "2022-blake3-aes-128-gcm",
"password": "{{ psk }}",
"uot": true
}
]
}
}
]
}
```
Client JSON (multi-user)
```json
{
"inbounds": [
{
"port": 10801,
"protocol": "socks",
"settings": {
"udp": true
}
},
{
"port": 10802,
"protocol": "http"
}
],
"outbounds": [
{
"protocol": "shadowsocks",
"settings": {
"servers": [
{
"address": "{{ host }}",
"port": 1234,
"method": "2022-blake3-aes-128-gcm",
"password": "{{ server psk }}:{{ user psk }}"
}
]
}
}
]
}
```
Client JSON (transit)
```json
{
"inbounds": [
{
"port": 10801,
"protocol": "socks",
"settings": {
"udp": true
}
},
{
"port": 10802,
"protocol": "http"
}
],
"outbounds": [
{
"protocol": "shadowsocks",
"settings": {
"servers": [
{
"address": "{{ host }}",
"port": 1234,
"method": "2022-blake3-aes-128-gcm",
"password": "{{ relay psk }}:{{ user psk }}"
}
]
}
}
]
}
```
## Password
Shadowsocks 2022 uses a pre-shared key similar to WireGuard for the password.
Use `openssl rand -base64 <length>` to generate a shadowsocks-rust compatible key, the length depends on the encryption method used.
| encryption method | key length |
|--------------------------------|-----:|
| 2022-blake3-aes-128-gcm | 16 |
| 2022-blake3-aes-256-gcm | 32 |
| 2022-blake3-chacha20-poly1305 | 32 |
In the Go implementation, 32-bit keys always work.

View File

@@ -1,5 +1,7 @@
# Shadowsocks 2022
[ENGLISH](README.ENG.md)
服务端 JSON
```json
@@ -236,4 +238,4 @@ Shadowsocks 2022 使用与 WireGuard 类似的预共享密钥作为密码。
| 2022-blake3-aes-256-gcm | 32 |
| 2022-blake3-chacha20-poly1305 | 32 |
在 Go 实现中32 位密钥始终工作。
在 Go 实现中32 位密钥始终工作。

View File

@@ -0,0 +1,81 @@
#Shadowsocks AEAD Quick Start
Server-side JSON
```json
{
"inbounds": [
{
"port": 12345,
"protocol": "shadowsocks",
"settings": {
"clients": [
{
"password": "example_user_1",
"method": "aes-128-gcm"
},
{
"password": "example_user_2",
"method": "aes-256-gcm"
},
{
"password": "example_user_3",
"method": "chacha20-poly1305"
}
],
"network": "tcp,udp"
}
}
],
"outbounds": [
{
"protocol": "freedom"
}
]
}
```
Client JSON
```json
{
"inbounds": [
{
"port": 10801,
"protocol": "socks",
"settings": {
"udp": true
}
},
{
"port": 10802,
"protocol": "http"
}
],
"outbounds": [
{
"protocol": "shadowsocks",
"settings": {
"servers": [
{
"address": "",
"port": 12345,
"password": "example_user_1",
"method": "aes-128-gcm"
}
]
}
}
]
}
```
## What's happening
No need for a graphical interface, just [**Xray-core**](https://github.com/XTLS/Xray-core) can quickly establish Shadowsocks AEAD encryption that supports Socks, HTTP proxy and **UDP FullCone** tunnel.
Xray-core has perfect support for UDP, thanks to the refactoring of each inbound and outbound code. The inbound UDP of Socks can accept requests from any network port.
As you can see, Xray-core also fully unleashes the potential of AEAD, **the server supports multiple users on a single port**, which is not implemented in any official version of Shadowsocks.
So when you need Shadowsocks, you only need Xray-core to solve the problem: high performance, cross-platform, easy to compile, and more powerful functions out of the box.

View File

@@ -1,5 +1,7 @@
# Shadowsocks AEAD 快速上手
[ENGLISH](README.ENG.md)
服务端 JSON
```json

View File

@@ -29,18 +29,18 @@
"settings": {
"servers": [
{
"address": "example.com", // IP
"flow": "xtls-rprx-direct", // Linux "xtls-rprx-splice"
"address": "example.com", // your domain name or server IP
"flow": "xtls-rprx-vision", // Linux or android can be changed to "xtls-rprx-splice"
"port": 443,
"password": "your_password" //
"password": "your_password" // your password
}
]
},
"streamSettings": {
"network": "tcp",
"security": "xtls",
"xtlsSettings": {
"serverName": "example.com" //
"security": "tls",
"tlsSettings": {
"serverName": "example.com" // your domain name
}
}
}

View File

@@ -9,8 +9,8 @@
"settings": {
"clients": [
{
"password":"your_password", //
"flow": "xtls-rprx-direct"
"password":"your_password", // password
"flow": "xtls-rprx-vison"
}
],
"fallbacks": [
@@ -27,20 +27,20 @@
},
"streamSettings": {
"network": "tcp",
"security": "xtls",
"xtlsSettings": {
"security": "tls",
"tlsSettings": {
"alpn": [
"http/1.1",
"h2"
],
"certificates": [
{
"certificateFile": "/path/to/cert", //
"keyFile": "/path/to/key", //
"ocspStapling": 3600 // 3600
"certificateFile": "/path/to/cert", // Certificate file absolute directory
"keyFile": "/path/to/key", // Key file absolute directory
"ocspStapling": 3600 // Verification cycle 3600 Second
}
],
"minVersion": "1.2" // ecc使 TLSv1.2 ecc
"minVersion": "1.2" // If it is an ecc certificate, use TLSv1.2 at least. If you don't know the certificate type or it is not an ecc certificate, delete this line
}
}
}

View File

@@ -0,0 +1,36 @@
# Trojan-gRPC-Caddy2/Nginx
## Schematic (Caddy):
Xray client <--- gRPC(TLS) ---> Caddy2 <--- gRPC(cleartext) ---> Xray server
## Nginx:
At the same time, you can also choose to use Nginx. A sample configuration snippet is as follows (partially from [@xqzr](https://github.com/xqzr)):
```conf
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name example.com;
index index.html;
root /var/www/html;
ssl_certificate /path/to/example.cer;
ssl_certificate_key /path/to/example.key;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE -RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
client_header_timeout 1w;
keepalive_timeout 30m;
# Fill in /your ServiceName after location
location /your ServiceName {
if ($content_type !~ "application/grpc") {
return 404;
}
client_max_body_size 0;
client_body_buffer_size 512k;
grpc_set_header X-Real-IP $remote_addr;
client_body_timeout 1w;
grpc_read_timeout 1w;
grpc_send_timeout 1w;
grpc_pass unix:/dev/shm/Xray-Trojan-gRPC.socket;
}
}
```

View File

@@ -1,12 +1,14 @@
# Trojan-gRPC-Caddy2Nginx
[ENGLISH](README.ENG.md)
## 原理图 (Caddy)
Xray client <--- gRPC(TLS) ---> Caddy2 <--- gRPC(cleartext) ---> Xray server
## Nginx
同时,您也可以选择使用 Nginx。示例配置片段如下部分来自 [@xqzr](https://github.com/xqzr)
```conf
server {
listen 443 ssl http2 so_keepalive=on;
listen [::]:443 ssl http2 so_keepalive=on;
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name example.com;
index index.html;
@@ -17,18 +19,19 @@ server {
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
client_header_timeout 52w;
keepalive_timeout 52w;
client_header_timeout 1w;
keepalive_timeout 30m;
# 在 location 后填写 /你的 ServiceName
location /你的 ServiceName {
if ($content_type !~ "application/grpc") {
if ($content_type !~ "^application/grpc") {
return 404;
}
client_max_body_size 0;
client_body_buffer_size 512k;
grpc_set_header X-Real-IP $remote_addr;
client_body_timeout 52w;
grpc_read_timeout 52w;
client_body_timeout 1w;
grpc_read_timeout 1w;
grpc_send_timeout 1w;
grpc_pass unix:/dev/shm/Xray-Trojan-gRPC.socket;
}
}

View File

@@ -1,9 +1,10 @@
xx.com {
@grpc {
protocol grpc
path # 填写 /你的 ServiceName/*
path /ServiceName/* # 修改为你自己的 ServiceName且仅能存在两个斜杠。/MyService/ServiceName/*会导致错误)
}
reverse_proxy @grpc unix//dev/shm/Xray-VLESS-gRPC.socket {
flush_interval -1
transport http {
versions h2c
}

36
VLESS-GRPC/README.ENG.md Normal file
View File

@@ -0,0 +1,36 @@
# VLESS-GRPC
## Schematic (Caddy):
Xray client <--- gRPC(TLS) ---> Caddy2 <--- gRPC(cleartext) ---> Xray server
## Nginx:
At the same time, you can also choose to use Nginx. A sample configuration snippet is as follows (partially from [@xqzr](https://github.com/xqzr)):
```conf
server {
listen 443 ssl http2 so_keepalive=on;
listen [::]:443 ssl http2 so_keepalive=on;
server_name example.com;
index index.html;
root /var/www/html;
ssl_certificate /path/to/example.cer;
ssl_certificate_key /path/to/example.key;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE -RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
client_header_timeout 52w;
keepalive_timeout 52w;
# Fill in /your ServiceName after location
location /your ServiceName {
if ($content_type !~ "application/grpc") {
return 404;
}
client_max_body_size 0;
client_body_buffer_size 512k;
grpc_set_header X-Real-IP $remote_addr;
client_body_timeout 52w;
grpc_read_timeout 52w;
grpc_pass unix:/dev/shm/Xray-VLESS-gRPC.socket;
}
}
```

View File

@@ -1,11 +1,14 @@
# VLESS-GRPC
[ENGLISH](README.ENG.md)
## 原理图 (Caddy)
Xray client <--- gRPC(TLS) ---> Caddy2 <--- gRPC(cleartext) ---> Xray server
## Nginx
同时,您也可以选择使用 Nginx。示例配置片段如下部分来自 [@xqzr](https://github.com/xqzr)
```conf
server {
listen 443 ssl http2 so_keepalive=on;
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name example.com;
index index.html;
@@ -16,18 +19,19 @@ server {
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
client_header_timeout 52w;
keepalive_timeout 52w;
client_header_timeout 1w;
keepalive_timeout 30m;
# 在 location 后填写 /你的 ServiceName
location /你的 ServiceName {
if ($content_type !~ "application/grpc") {
if ($content_type !~ "^application/grpc") {
return 404;
}
client_max_body_size 0;
client_body_buffer_size 512k;
grpc_set_header X-Real-IP $remote_addr;
client_body_timeout 52w;
grpc_read_timeout 52w;
client_body_timeout 1w;
grpc_read_timeout 1w;
grpc_send_timeout 1w;
grpc_pass unix:/dev/shm/Xray-VLESS-gRPC.socket;
}
}

View File

@@ -36,10 +36,11 @@
"network": "grpc",
"security": "tls",
"grpcSettings": {
"serviceName": "", // ServiceName
"serviceName": "", // ServiceName
"multiMode": false,
//"idle_timeout": 60, //
//"initial_windows_size": 35536 // Cloudflare CDN Cloudflare CDN h2 GOAWAY
//"initial_windows_size": 35536, // Cloudflare CDN Cloudflare CDN h2 GOAWAY
//"permit_without_stream": true // Cloudflare CDN Cloudflare CDN
}
}
},

View File

@@ -0,0 +1,9 @@
Xray 基于 HTTP/2 或 HTTP/3 的传输方式完整按照 HTTP 标准实现,可以通过其它的 HTTP 服务器(如 Caddy进行中转。
Caddy 使用 reverse_proxy 模块,一般使用 path 分流,主路径伪装为网站,中间人无法探测到 Xray-core请使用复杂 path
Caddy 默认开启 UDP 同端口的 HTTP/3 服务器,目前支持三种中转方式
- HTTP/2
- HTTP/3 解密后重新加密
- HTTP/3 转 H2C

View File

@@ -1,6 +1,10 @@
xx.com {
log {
level DEBUG
}
root * /var/www
file_server
tls CA.crt priv.key # 换成你的证书和私钥,绝对路径
reverse_proxy /path 127.0.0.1:2001 {
transport http {

View File

@@ -0,0 +1,17 @@
xx.com {
log {
level DEBUG
}
root * /var/www
file_server
tls CA.crt priv.key # 换成你的证书和私钥,绝对路径
reverse_proxy /path 127.0.0.1:2001 {
transport http {
tls
tls_client_auth CA.crt priv.key # 换成你的证书和私钥,绝对路径
tls_server_name xx.com
versions 3
}
}
}

View File

@@ -0,0 +1,7 @@
# 原理图:
Xray client <--- H3 ---> Caddy2 <--- H3 ---> Xray server
注意:
由于 H3 没有解密的明文传输标准 这种模式 Caddy 解密流量之后 会重新加密 会增加少许延迟和负载
目前仅 Caddy2 的 v2.9.0-beta.2 版及以后完美支持 Xray 的 H3 入站。

View File

@@ -0,0 +1,73 @@
{
"log":{},
"inbounds":[
{
"port":"1080",
"protocol":"socks",
"settings":{
"auth":"noauth",
"udp":true
}
},
{
"port":"1081",
"protocol":"http",
"settings":{}
}
],
"outbounds":[
{
"protocol":"vless",
"settings":{
"vnext":[
{
"address":"xx.com",
"port":443,
"users":[
{
"id":"",
"encryption":"none"
}
]
}
]
},
"streamSettings":{
"network":"http",
"security":"tls",
"httpSettings":{
"host":[
"xx.com"
],
"path":"/path"
}
},
"tlsSettings":{
"alpn":["h3"],
"serverName":"xx.com"
}
},
{
"tag":"direct",
"protocol":"freedom",
"settings":{}
},
{
"tag":"blocked",
"protocol":"blackhole",
"settings":{}
}
],
"routing":{
"domainStrategy":"IPOnDemand",
"rules":[
{
"type":"field",
"ip":[
"geoip:private"
],
"outboundTag":"direct"
}
]
}
}

View File

@@ -0,0 +1,66 @@
{
"log": {
"loglevel": "warning"
},
"inbounds": [
{
"port": 2001,
"listen": "127.0.0.1",
"protocol": "vless",
"settings": {
"clients": [
{
"id": "",
"email": "love@example.com"
}
],
"decryption": "none"
},
"streamSettings": {
"security": "tls",
"network": "http",
"httpSettings": {
"path": "/path",
"host": [
"xx.com"
]
},
"tlsSettings": {
// "rejectUnknownSni": true,
"minVersion": "1.3",
"alpn": ["h3"],
"certificates": [
{
"certificateFile": "CA.crt", // 换成你的证书,绝对路径
"keyFile": "priv.key" // 换成你的私钥,绝对路径
}
]
}
}
}
],
"outbounds": [
{
"tag": "direct",
"protocol": "freedom",
"settings": {}
},
{
"tag": "blocked",
"protocol": "blackhole",
"settings": {}
}
],
"routing": {
"domainStrategy": "AsIs",
"rules": [
{
"type": "field",
"ip": [
"geoip:private"
],
"outboundTag": "blocked"
}
]
}
}

View File

@@ -0,0 +1,11 @@
xx.com {
log {
level DEBUG
}
root * /var/www
file_server
tls CA.crt priv.key # 换成你的证书和私钥,绝对路径
reverse_proxy /path h2c://127.0.0.1:2001 {
}
}

View File

@@ -0,0 +1,5 @@
# 原理图:
Xray client <--- H3 ---> Caddy2 <--- H2C ---> Xray server
注意:
目前仅 Caddy2 的 v2.9.0-beta.2 版及以后完美支持 H3 转换 H2C 对接 Xray 的 H2C 入站。

View File

@@ -0,0 +1,73 @@
{
"log":{},
"inbounds":[
{
"port":"1080",
"protocol":"socks",
"settings":{
"auth":"noauth",
"udp":true
}
},
{
"port":"1081",
"protocol":"http",
"settings":{}
}
],
"outbounds":[
{
"protocol":"vless",
"settings":{
"vnext":[
{
"address":"xx.com",
"port":443,
"users":[
{
"id":"",
"encryption":"none"
}
]
}
]
},
"streamSettings":{
"network":"http",
"security":"tls",
"httpSettings":{
"host":[
"xx.com"
],
"path":"/path"
},
"tlsSettings":{
"alpn":["h3"],
"serverName":"xx.com"
}
}
},
{
"tag":"direct",
"protocol":"freedom",
"settings":{}
},
{
"tag":"blocked",
"protocol":"blackhole",
"settings":{}
}
],
"routing":{
"domainStrategy":"IPOnDemand",
"rules":[
{
"type":"field",
"ip":[
"geoip:private"
],
"outboundTag":"direct"
}
]
}
}

View File

@@ -0,0 +1,55 @@
{
"log": {
"loglevel": "warning"
},
"inbounds": [
{
"port": 2001,
"listen": "127.0.0.1",
"protocol": "vless",
"settings": {
"clients": [
{
"id": "",
"email": "love@example.com"
}
],
"decryption": "none"
},
"streamSettings": {
"security": "none",
"network": "http",
"httpSettings": {
"path": "/path",
"host": [
"xx.com"
]
}
}
}
],
"outbounds": [
{
"tag": "direct",
"protocol": "freedom",
"settings": {}
},
{
"tag": "blocked",
"protocol": "blackhole",
"settings": {}
}
],
"routing": {
"domainStrategy": "AsIs",
"rules": [
{
"type": "field",
"ip": [
"geoip:private"
],
"outboundTag": "blocked"
}
]
}
}

View File

@@ -0,0 +1,5 @@
# 不会被偷跑流量的 REALITY
一个老生常谈的问题,对于非法请求, reality都会无脑转发流量去dest如果reality的dest指向一个cloudflare网站那么相当于服务端变成了CF的端口转发任何人扫过来都可以拿来嫖。
目前的解决办法是不要使用这类的网站作为 dest, 懂一点的会告诉你用 nginx 的 stream 滤一遍 SNI 并丢掉非法请求,但是其实 Xray 本身就支持这种操作,这也是这个模板的原理

View File

@@ -0,0 +1,56 @@
// 直接从其他示例里 copy 过来的,客户端不需要任何特殊修改,要填的东西也一致
{
"log": {
"loglevel": "debug"
},
"inbounds": [
{
"listen": "127.0.0.1",
"port": 10808,
"protocol": "socks",
"settings": {
"udp": true
},
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls",
"quic"
],
"routeOnly": true
}
}
],
"outbounds": [
{
"protocol": "vless",
"settings": {
"vnext": [
{
"address": "127.0.0.1",
"port": 443,
"users": [
{
"id": "", // Needs to match server side
"encryption": "none"
}
]
}
]
},
"streamSettings": {
"network": "tcp",
"security": "reality",
"realitySettings": {
"fingerprint": "chrome",
"serverName": "speed.cloudflare.com",
"publicKey": "",
"spiderX": "",
"shortId": ""
}
},
"tag": "proxy"
}
]
}

View File

@@ -0,0 +1,93 @@
{
"log": {
"loglevel": "debug"
},
"inbounds": [
{
"tag": "dokodemo-in",
"port": 443,
"protocol": "dokodemo-door",
"settings": {
"address": "127.0.0.1",
"port": 4431, // 指向内网中的 reality 端口,示例是这个端口,如果要自己修改了记得这里和下面的 reality 入站都要修改
"network": "tcp"
},
"sniffing": { // 这里的 sniffing 不是多余的,别乱动
"enabled": true,
"destOverride": [
"tls"
],
"routeOnly": true
}
},
{
"listen": "127.0.0.1",
"port": 4431, // 见上 如果和其他服务冲突了可以换
"protocol": "vless",
"settings": {
"clients": [
{
"id": "" // uuid
}
],
"decryption": "none"
},
"streamSettings": {
"network": "tcp",
"security": "reality",
"realitySettings": {
// 下方要求和普通 reality 一致,这里演示 dest 设置为 cloudflare 不被偷跑流量所以设置为 speed.cloudflare.com 了
// 你可以设置为其他 CF 网站,如果你的 dest 不是这种网站你也不用点了进来不是吗
"dest": "speed.cloudflare.com:443",
"serverNames": [
"speed.cloudflare.com"
],
"privateKey": "", // 运行 `xray x25519` 生成
"shortIds": [
"",
"0123456789abcdef"
]
}
},
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls",
"quic"
],
"routeOnly": true
}
}
],
"outbounds": [
{
"protocol": "freedom",
"tag": "direct"
},
{
"protocol": "blackhole",
"tag": "block"
}
],
"routing": {
"rules": [
{
"inboundTag": [
"dokodemo-in"
],
// 重要,这个域名列表需要和 realitySettings 的 serverNames 保持一致
"domain": [
"speed.cloudflare.com"
],
"outboundTag": "direct"
},
{
"inboundTag": [
"dokodemo-in"
],
"outboundTag": "block"
}
]
}
}

View File

@@ -0,0 +1,18 @@
# VLESS over TCP with TLS + fallback (simplest configuration)
You need to have a domain name resolved to the server IP, and apply for a certificate, such as let's encrypt
You also need an Nginx: (or any web server like Caddy)
1. Use the package manager that comes with the system to install nginx. For details, please Google
2. The default configuration of nginx is to listen to port 80, no need to modify
3. Optional: Find and replace the index.html and other files that come with nginx
4. Execute `systemctl enable nginx` to set up autostart
5. Execute `systemctl start nginx` to start nginx
If the server has a firewall enabled or the VPS has a security group, remember to allow ports TCP/80 and 443
---
Next, you can learn about [site building configuration](<../VLESS-TCP-TLS%20(maximal%20by%20rprx)>) (fall back to advanced usage), try [advanced configuration](<../VLESS- TCP-TLS-WS%20(recommended)>) (distribution to WebSocket)

View File

@@ -1,4 +1,5 @@
# VLESS over TCP with TLS + 回落(最简配置)
[ENGLISH](README.ENG.md)
你需要有一个解析到服务器 IP 的域名,并且申请了证书,比如 let's encrypt

View File

@@ -0,0 +1,19 @@
# VLESS over TCP with TLS + fallback & split to WebSocket (advanced configuration)
## Caution
**This configuration was tagged as recommended, however https://github.com/XTLS/Xray-core/issues/1750#issuecomment-1459469821 had mentioned its vulnerabilities and it should be tagged as <u>deprecated</u>.**
## Original Content
This is a superset of [Minimal Configuration](<../VLESS-TCP-TLS%20(minimal%20by%20rprx)>), using the powerful fallback and distribution features of VLESS, it realizes port 443 VLESS over TCP with TLS and Perfect coexistence of any WSS
This configuration is for reference. You can replace VLESS on WS with any other protocol such as VMess, and set more PATHs and protocol coexistence.
After deployment, you can connect to the server through VLESS over TCP with TLS and any WebSocket with TLS at the same time, the latter of which can be through CDN
According to the actual measurement, the performance of VLESS fallback shunt WS is stronger than that of Nginx reverse generation WS. The traditional VMess + WSS solution can be completely migrated without loss of compatibility.
---
Next, you can try [Ultimate Configuration](../VLESS-TCP-XTLS-WHATEVER): switch to XTLS to achieve ultimate performance, and offload to VMess over TCP, and more fallback and offload suggestions, not only Xray

View File

@@ -1,5 +1,13 @@
# VLESS over TCP with TLS + 回落 & 分流 to WebSocket进阶配置
## 注意
**这个配置过去被标记为推荐,然而 https://github.com/XTLS/Xray-core/issues/1750#issuecomment-1459469821 提到其安全缺陷,且它应当列为<u>已废弃</u>。**
## 原文
[ENGLISH](README.ENG.md)
这里是 [最简配置](<../VLESS-TCP-TLS%20(minimal%20by%20rprx)>) 的超集,利用 VLESS 强大的回落分流特性,实现了 443 端口 VLESS over TCP with TLS 和任意 WSS 的完美共存
该配置供参考,你可以将 WS 上的 VLESS 换成 VMess 等其它任何协议,以及设置更多 PATH、协议共存都可以做到

View File

@@ -0,0 +1,7 @@
# This is a minimal configuration file.
**About dest**
If you use `1.1.1.1:443` as dest, an IP certificate is used. You can also leave `serverNames` empty, it is a possible way to bypass [Iran's speed restrictions.](https://t.me/hysteria_github/78830/149362).
**About REALITY**
See [XTLS/REALITY](https://github.com/XTLS/REALITY).
In English See [REALITY.ENG](REALITY.ENG.md)

View File

@@ -0,0 +1,102 @@
# REALITY
### THE NEXT FUTURE
Server side implementation of REALITY protocol, a fork of package tls in Go 1.19.5.
For client side, please follow https://github.com/XTLS/Xray-core/blob/main/transport/internet/reality/reality.go.
TODO List: TODO
## VLESS-XTLS-uTLS-REALITY example for [Xray-core](https://github.com/XTLS/Xray-core) [ENG]
```json5
{
"inbounds": [ // Server-side inbound configuration
{
"listen": "0.0.0.0",
"port": 443,
"protocol": "vless",
"settings": {
"clients": [
{
"id": "", // Required, generated with ./xray uuid or a 1-30 character string
"flow": "xtls-rprx-vision" // Optional, if specified, clients must enable XTLS
}
],
"decryption": "none"
},
"streamSettings": {
"network": "tcp",
"security": "reality",
"realitySettings": {
"show": false, // Optional, if true, outputs debug information
"dest": "example.com:443", // Required, format similar to VLESS fallbacks' dest
"xver": 0, // Optional, format similar to VLESS fallbacks' xver
"serverNames": [ // Required, list of serverNames available to clients, * wildcard is not supported yet
"example.com",
"www.example.com"
],
"privateKey": "", // Required, generated with ./xray x25519
"minClientVer": "", // Optional, minimum client Xray version, format x.y.z
"maxClientVer": "", // Optional, maximum client Xray version, format x.y.z
"maxTimeDiff": 0, // Optional, maximum allowed time difference in milliseconds
"shortIds": [ // Required, list of shortIds available to clients, can be used to distinguish different clients
"", // If this item exists, client shortId can be empty
"0123456789abcdef" // 0 to f, length is a multiple of 2, maximum length is 16
]
}
}
}
]
}
```
By replacing TLS with REALITY, **you can eliminate server-side TLS fingerprint characteristics**, maintain forward secrecy, **and render certificate chain attacks ineffective**. **This allows for pointing to another website** without the need to purchase a domain or configure a TLS server, **making it more convenient to present a specified SNI throughout the entire TLS handshake**.
Typical use cases for proxying involve minimum requirements for target websites: **foreign websites, support for TLSv1.3 and H2, with non-redirected domains** (the primary domain may be used for redirection to www). Bonus features include proximity in IP (more similar with low latency), encrypted handshake messages after the Server Hello (e.g., dl.google.com), and OCSP Stapling. **Configuration bonuses include blocking traffic back to your country, forwarding TCP/80, and UDP/443** (REALITY externally appears as port forwarding, so it might be better for less commonly used destination IPs).
**REALITY can also be used in conjunction with proxy protocols other than XTLS**, but it is not recommended as they exhibit clear TLS-in-TLS characteristics that have already been targeted. REALITY's next major goal is the "**prebuilt mode**," which involves collecting target website features in advance, while XTLS's next major goal is **0-RTT**.
```json5
{
"outbounds": [ // Client-side outbound configuration
{
"protocol": "vless",
"settings": {
"vnext": [
{
"address": "", // Server's domain or IP
"port": 443,
"users": [
{
"id": "", // Matching the server-side
"flow": "xtls-rprx-vision", // Matching the server-side
"encryption": "none"
}
]
}
]
},
"streamSettings": {
"network": "tcp",
"security": "reality",
"realitySettings": {
"show": false, // Optional, outputs debug information if true
"fingerprint": "chrome", // Required, simulates the client TLS fingerprint using the uTLS library
"serverName": "", // One of the server's serverNames
"publicKey": "", // The public key corresponding to the server's private key
"shortId": "", // One of the server's shortIds
"spiderX": "" // Initial path and parameters for web crawlers, recommended to be different for each client
}
}
}
]
}
```
REALITY clients should receive a "**temporary trusted certificate**" signed by the "**temporary authentication key.**" However, three scenarios can lead to receiving the target website's genuine certificate:
1. The REALITY server rejects the client's Client Hello, and traffic is redirected to the target website.
2. The client's Client Hello is redirected to the target website by a man-in-the-middle.
3. A man-in-the-middle attack occurs, which could be assisted by the target website or be a certificate chain attack.
REALITY clients can perfectly distinguish between temporary trusted certificates, genuine certificates, and invalid certificates, and decide the next steps:
1. When a temporary trusted certificate is received, the connection is usable, and everything proceeds as usual.
2. When a genuine certificate is received, the client enters spider mode.
3. When an invalid certificate is received, a TLS alert is triggered, and the connection is terminated.

View File

@@ -0,0 +1,56 @@
{
"log": {
"loglevel": "debug"
},
"inbounds": [
{
"listen": "127.0.0.1",
"port": 10808,
"protocol": "socks",
"settings": {
"udp": true
},
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls",
"quic"
],
"routeOnly": true
}
}
],
"outbounds": [
{
"protocol": "vless",
"settings": {
"vnext": [
{
"address": "",
"port": 443,
"users": [
{
"id": "", // Needs to match server side
"encryption": "none",
"flow": "xtls-rprx-vision"
}
]
}
]
},
"streamSettings": {
"network": "tcp",
"security": "reality",
"realitySettings": {
"fingerprint": "chrome",
"serverName": "", // A website that support TLS1.3 and h2. If your dest is `1.1.1.1:443`, then leave it empty
"publicKey": "", // run `xray x25519` to generate. Public and private keys need to be corresponding.
"spiderX": "", // If your dest is `1.1.1.1:443`, then you can fill it with `/dns-query/` or just leave it empty
"shortId": "" // Required
}
},
"tag": "proxy"
}
]
}

View File

@@ -0,0 +1,50 @@
{
"log": {
"loglevel": "debug"
},
"inbounds": [
{
"port": 443,
"protocol": "vless",
"settings": {
"clients": [
{
"id": "", // run `xray uuid` to generate
"flow": "xtls-rprx-vision"
}
],
"decryption": "none"
},
"streamSettings": {
"network": "tcp",
"security": "reality",
"realitySettings": {
"dest": "", // A website that support TLS1.3 and h2. You can also use `1.1.1.1:443` as dest
"serverNames": [
"" // A server name in the cert of dest site. If you use `1.1.1.1:443` as dest, then you can leave `serverNames` empty, it is a possible ways to bypass Iran's internet speed restrictions.
],
"privateKey": "", // run `xray x25519` to generate. Public and private keys need to be corresponding.
"shortIds": [// Required, list of shortIds available to clients, can be used to distinguish different clients
"", // If this item exists, client shortId can be empty
"0123456789abcdef" // 0 to f, length is a multiple of 2, maximum length is 16
]
}
},
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls",
"quic"
],
"routeOnly": true
}
}
],
"outbounds": [
{
"protocol": "freedom",
"tag": "direct"
}
]
}

View File

@@ -0,0 +1,16 @@
:+1:**XTLS Vision [Introduction](https://github.com/XTLS/Xray-core/discussions/1295)**
**Usage Reminder:**
:exclamation: Compared with the usage base of XTLS Vision, there are almost no reports of Vision being blocked with **correct configuration**. **Correct configuration** refers to:
1. The server uses a reasonable port and prohibits traffic returning to China
2. Only configure XTLS Vision, not compatible with ordinary TLS proxy
3. Fall back to the web page, do not fall back/distribute to other proxy agreements
4. Client enables uTLS (fingerprint) [#1](https://github.com/XTLS/Xray-core/issues/1544#issuecomment-1399194727)
First of all, if you really don't want to be blocked, **please choose a clean IP** first, and build and use XTLS Vision according to **correct configuration**.
**However, even if you do this, there is no guarantee that you will not be blocked** 100%. Since the end of last year, many people's unknown traffic has been blocked in seconds, and TLS in TLS traffic has been blocked every other day. XTLS Vision is not unknown traffic, and fully handles TLS in TLS features, so far it seems to be effective. **But this does not mean that XTLS Vision can be 100% unblocked. It is very, very important to realize this, and don't make a fuss if you are accidentally blocked**.
**Because besides the agreement itself, there are many angles that can block you**. Taking IP as an example, you can't guarantee that the IP is really clean, you can't avoid being affected by neighbors, and you can't avoid the entire IP segment being pulled out of the list. It is also possible that GFWs in certain regions have unique standards. For example, if a certain IP has only a few people accessing it, but it can run so much traffic, it will be blocked. **If your XTLS Vision is blocked, but there is no large-scale blocked report like TLS at the end of last year, I sincerely suggest that you change the port, change the IP, and change the service provider to try again**. [#2](https://github.com/XTLS/Xray-core/issues/1544#issuecomment-1402118517)

View File

@@ -0,0 +1,18 @@
:+1:**XTLS Vision [简介](https://github.com/XTLS/Xray-core/discussions/1295)**
[ENGLISH](README.ENG.md)
**使用提醒:**
:exclamation:相对于 XTLS Vision 的使用基数,目前几乎没有收到 **配置正确** 的 Vision 被封端口的报告,**配置正确** 指的是:
1. 服务端使用合理的端口,禁回国流量
2. 只配置 XTLS Vision不兼容普通 TLS 代理
3. 回落到网页,不回落/分流到其它代理协议
4. 客户端启用 uTLSfingerprint [#1](https://github.com/XTLS/Xray-core/issues/1544#issuecomment-1399194727)
首先,如果你特别不想被封,**请先选择一个干净的 IP**,并按照 **配置正确** 去搭建、使用 XTLS Vision。
**但是,即使你这样做了,也无法保证 100% 不被封**。自去年底始,很多人的未知流量秒封 IPTLS in TLS 流量隔天封端口。XTLS Vision 不是未知流量,且完整处理了 TLS in TLS 特征,目前看来效果显著。**但这并不意味着,用 XTLS Vision 可以 100% 不被封,认识到这一点是非常、非常重要的,不要自己偶然被封就大惊小怪**。
**因为除了协议本身,还有很多角度能封你**。以 IP 为例,你无法保证 IP 真的干净,无法避免被邻居波及,无法避免整个 IP 段被重点拉清单。也有可能某些地区的 GFW 有独特的标准,比如某个 IP 只有寥寥数人访问连却能跑那么多流量,封。**如果你的 XTLS Vision 被封了,但没有出现去年底 TLS 那样的大规模被封报告,我真心建议你换端口、换 IP、换服务商依次试一遍**。 [#2](https://github.com/XTLS/Xray-core/issues/1544#issuecomment-1402118517)

View File

@@ -25,8 +25,8 @@
},
"inbounds": [
{
"listen": "127.0.0.1",
"port": 10808, // v2rayN
"listen": "127.0.0.1", // Fill in 0.0.0.0 to allow connections from LAN
"port": 10808, // local socks listening port
"protocol": "socks",
"settings": {
"udp": true
@@ -40,8 +40,8 @@
}
},
{
"listen": "127.0.0.1",
"port": 10809, // v2rayN
"listen": "127.0.0.1", // Fill in "0.0.0.0" to allow connections from LAN
"port": 10809, // Local http listening port
"protocol": "http",
"sniffing": {
"enabled": true,
@@ -58,11 +58,11 @@
"settings": {
"vnext": [
{
"address": "", // VPSIP
"port": 16387, // VPS
"address": "", // Address, domain name or IP of the server
"port": 443, // Port, consistent with the server
"users": [
{
"id": "", // ID
"id": "", // User ID, consistent with the server
"encryption": "none",
"flow": "xtls-rprx-vision"
}
@@ -74,9 +74,9 @@
"network": "tcp",
"security": "tls",
"tlsSettings": {
"serverName": "", //
"serverName": "", // SNI, if "address" is filled with the domain name of the server, it can be left blank. If "address" is filled with the IP of the server, fill in the domain name contained in the certificate of the server here
"allowInsecure": false,
"fingerprint": "chrome" // uTLS Chrome / Firefox / Safari
"fingerprint": "chrome" // Used to configure the fingerprint of the specified TLS Client Hello, Xray will simulate the TLS fingerprint through the uTLS library, or generate it randomly
}
},
"tag": "proxy"
@@ -84,6 +84,10 @@
{
"protocol": "freedom",
"tag": "direct"
},
{
"protocol": "blackhole",
"tag": "block"
}
]
}

Some files were not shown because too many files have changed in this diff Show More