Browse Source

add Caddy (using header)

kirikira 8 years ago
parent
commit
e5f97678e2

BIN
How_To_Choose.jpg


+ 7 - 0
README.md

@@ -11,6 +11,13 @@
 
 如果你在配置过程中遇到问题,请再看一遍文档,或是在Google搜索以求自己解决问题。当你确认你的问题无法独立解决时,你可以在v2ray的telegram群组里求助,或是在v2ray官方项目中提交issue。<br>
 遇事不决,请RTFM/STFW。<br>
+
+**如何选取适合自己的配置**:
+![](How_To_Choose.jpg)
+附加说明:<br>
+尽管websocket+TLS+Web可能称得上是现阶段最好的方案,但**绝对**不是推荐新手一上来就尝试的方案,更不是V2Ray唯一的用法。<br>
+同时,你应当了解,每个地区的网络状况不同(主要指对不同协议的QoS程度),你可以将所有配置都尝试一遍来寻找最适合自己的,尽量少问、最好不问"为什么我的V2Ray这么慢?"这样的问题。
+
 玩的愉快。
 
 感谢Project V的所有开发人员,以及v2ray.fun的作者雨落无声。

+ 1 - 2
http/config_server.json

@@ -63,8 +63,7 @@
             "reason": "OK",
             "version": "1.1"
           }
-        },
-        "connectionReuse": true
+        }
       },
       "tlsSettings": {},
       "security": ""

+ 17 - 0
websocket+Caddy+TLS(use header)/Caddyfile

@@ -0,0 +1,17 @@
+https://example.domain * {
+ gzip
+ tls [email protected]
+ proxy / https://www.baidu.com
+ log / stdout "{request}"
+ 
+ rewrite {
+  if {host} is google.com
+  to /test
+ }
+ 
+ proxy /test localhost:1234 {
+  websocket
+  without /test
+ } 
+}
+

+ 105 - 0
websocket+Caddy+TLS(use header)/config_client.json

@@ -0,0 +1,105 @@
+{
+  "outbound": {
+    "streamSettings": {
+      "network": "ws",
+      "kcpSettings": null,
+      "wsSettings": {
+        "headers": {
+          "host": "google.com"
+        },
+        "path": "/"
+      },
+      "tcpSettings": null,
+      "tlsSettings": {},
+      "security": "tls"
+    },
+    "tag": "agentout",
+    "protocol": "vmess",
+    "mux": {
+      "enabled": true,
+      "concurrency": 8
+    },
+    "settings": {
+      "vnext": [{
+        "users": [{
+          "alterId": 100,
+          "security": "aes-128-gcm",
+          "id": "e2b39869-7e9e-411b-a561-00904419bed9"
+        }],
+        "port": 443,
+        "address": "example.domain"
+      }]
+    }
+  },
+  "log": {
+    "access": "",
+    "loglevel": "info",
+    "error": ""
+  },
+  "outboundDetour": [{
+      "tag": "direct",
+      "protocol": "freedom",
+      "settings": {
+        "response": null
+      }
+    },
+    {
+      "tag": "blockout",
+      "protocol": "blackhole",
+      "settings": {
+        "response": {
+          "type": "http"
+        }
+      }
+    }
+  ],
+  "inbound": {
+    "streamSettings": null,
+    "settings": {
+      "ip": "127.0.0.1",
+      "udp": true,
+      "clients": null,
+      "auth": "noauth"
+    },
+    "protocol": "socks",
+    "port": 10086,
+    "listen": "0.0.0.0"
+  },
+  "inboundDetour": null,
+  "routing": {
+    "settings": {
+      "rules": [{
+        "ip": [
+          "0.0.0.0/8",
+          "10.0.0.0/8",
+          "100.64.0.0/10",
+          "127.0.0.0/8",
+          "169.254.0.0/16",
+          "172.16.0.0/12",
+          "192.0.0.0/24",
+          "192.0.2.0/24",
+          "192.168.0.0/16",
+          "198.18.0.0/15",
+          "198.51.100.0/24",
+          "203.0.113.0/24",
+          "::1/128",
+          "fc00::/7",
+          "fe80::/10"
+        ],
+        "domain": null,
+        "type": "field",
+        "port": null,
+        "outboundTag": "direct"
+      }],
+      "domainStrategy": "IPIfNonMatch"
+    },
+    "strategy": "rules"
+  },
+  "dns": {
+    "servers": [
+      "8.8.8.8",
+      "8.8.4.4",
+      "localhost"
+    ]
+  }
+}

+ 84 - 0
websocket+Caddy+TLS(use header)/config_server.json

@@ -0,0 +1,84 @@
+{
+  "outbound": {
+    "streamSettings": null,
+    "tag": null,
+    "protocol": "freedom",
+    "mux": null,
+    "settings": null
+  },
+  "log": {
+    "access": "/var/log/v2ray/access.log",
+    "loglevel": "info",
+    "error": "/var/log/v2ray/error.log"
+  },
+  "outboundDetour": [{
+      "tag": "direct",
+      "protocol": "freedom",
+      "settings": null
+    },
+    {
+      "tag": "blocked",
+      "protocol": "blackhole",
+      "settings": null
+    }
+  ],
+  "inbound": {
+    "streamSettings": {
+      "network": "ws",
+      "kcpSettings": null,
+      "wsSettings": {
+        "headers": {
+          "host": "google.com"
+        },
+        "path": "/"
+      },
+      "tcpSettings": null,
+      "tlsSettings": {},
+      "security": ""
+    },
+    "settings": {
+      "ip": null,
+      "udp": true,
+      "clients": [{
+        "alterId": 100,
+        "security": "aes-128-gcm",
+        "id": "e2b39869-7e9e-411b-a561-00904419bed9"
+      }],
+      "auth": null
+    },
+    "protocol": "vmess",
+    "port": 1234,
+    "listen": null
+  },
+  "inboundDetour": null,
+  "routing": {
+    "settings": {
+      "rules": [{
+        "ip": [
+          "0.0.0.0/8",
+          "10.0.0.0/8",
+          "100.64.0.0/10",
+          "127.0.0.0/8",
+          "169.254.0.0/16",
+          "172.16.0.0/12",
+          "192.0.0.0/24",
+          "192.0.2.0/24",
+          "192.168.0.0/16",
+          "198.18.0.0/15",
+          "198.51.100.0/24",
+          "203.0.113.0/24",
+          "::1/128",
+          "fc00::/7",
+          "fe80::/10"
+        ],
+        "domain": null,
+        "type": "field",
+        "port": null,
+        "outboundTag": "blocked"
+      }],
+      "domainStrategy": null
+    },
+    "strategy": "rules"
+  },
+  "dns": null
+}

+ 0 - 0
websocket+Caddy+TLS/Caddyfile → websocket+Caddy+TLS(use path)/Caddyfile


+ 0 - 0
websocket+Caddy+TLS/config_client.json → websocket+Caddy+TLS(use path)/config_client.json


+ 1 - 2
websocket+Caddy+TLS/config_server.json → websocket+Caddy+TLS(use path)/config_server.json

@@ -30,8 +30,7 @@
         "headers": {
           "host": "example.domain"
         },
-        "path": "/test",
-        "connectionReuse": true
+        "path": "/test"
       },
       "tcpSettings": null,
       "tlsSettings": {},

+ 1 - 2
websocket+TLS/config_server.json

@@ -20,8 +20,7 @@
     "headers": {
      "host": "example.domain"
     }, 
-    "path": "", 
-    "connectionReuse": true
+    "path": "" 
    }, 
    "tcpSettings": null, 
    "tlsSettings": {

+ 1 - 2
websocket/config_server.json

@@ -20,8 +20,7 @@
         "headers": {
           "host": "example.domain"
         },
-        "path": "",
-        "connectionReuse": true
+        "path": ""
       },
       "tcpSettings": null,
       "tlsSettings": {},