Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP协议的实现问题 #283

Closed
husy8 opened this issue Nov 7, 2016 · 3 comments
Closed

HTTP协议的实现问题 #283

husy8 opened this issue Nov 7, 2016 · 3 comments

Comments

@husy8
Copy link
Contributor

husy8 commented Nov 7, 2016

1) 你正在使用哪个版本的 V2Ray?(如果服务器和客户端使用了不同版本,请注明)
1) What version of V2Ray are you using?

V2ray 2.5 Release

2) 你的使用场景是什么?比如使用 Chrome 通过 Socks/VMess 代理观看 YouTube 视频。
2) What your scenario of using V2Ray? E.g., Watching YouTube videos in Chrome via Socks/VMess proxy.

使用Chrome(Version:54.0.2840.87 m)通过 Socks5浏览网页

3) 你看到的不正常的现象是什么?
3) What did you see?

v

使用WIreShark抓包。走V2ray通道数据包无一例外均为TCP协议,并没有发现HTTP协议数据分组。

4) 你期待看到的正确表现是怎样的?
4) What do you expected to see instead?

default

同样使用WireShark抓包,正常访问网页数据分组尽管大部分为TCP,却有少量HTTP协议存在。

那么问题来了,是我配置文件不正确还是V2ray就是这样实现HTTP协议的呢?

5) 请附上你的配置文件。
5) Please attach your configuration file.

Server:

{
  "log" : {
    "access": "/var/log/v2ray/access.log",
    "error": "/var/log/v2ray/error.log",
    "loglevel": "warning"
  },
  "inbound": {
    "port": 80,
    "protocol": "vmess",
    "settings": {
      "clients": [
        {
          "id": "_UUID_",
          "level": 1,
          "alterId": 256
        }
      ]
    },
    "streamSettings": {
      "network": "tcp",
      "security": "none",
      "tcpSettings": {
        "connectionReuse": true,
        "header": {
          "type": "http",
          "request": {
            "version": "1.1",
            "method": "GET",
            "path": ["/"],
            "headers": {
              "Host": ["www.toutiao.com", "www.baidu.com"],
              "User-Agent": [
                "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.87 Safari/537.36",
                        "Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_2 like Mac OS X) AppleWebKit/601.1 (KHTML, like Gecko) CriOS/53.0.2785.109 Mobile/14A456 Safari/601.1.46"
              ]
            }
          },
          "response": {
            "version": "1.1",
            "status": "200",
            "reason": "OK",
            "headers": {
              "Content-Type": ["text/html", "application/x-javascript"],
              "Transfer-Encoding": ["chunked"]
            }
          }
        }
      }
    }
  },
  "outbound": {
    "protocol": "freedom",
    "settings": {}
  },
  "outboundDetour": [
    {
      "protocol": "blackhole",
      "settings": {},
      "tag": "blocked"
    }
  ],
  "routing": {
    "strategy": "rules",
    "settings": {
      "rules": [
        {
          "type": "chinaip",
          "outboundTag": "blocked"
        },
        {
          "type": "chinasites",
          "outboundTag": "blocked"
        },
        {
          "type": "field",
          "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"
          ],
          "outboundTag": "blocked"
        }
      ]
    }
  },
  "transport": {
    "tcpSettings": {
      "connectionReuse": true,
      "header": {
        "type": "http",
        "request": {
          "version": "1.1",
          "method": "GET",
          "path": ["/"],
          "headers": {
            "Host": ["www.toutiao.com", "www.baidu.com"],
            "User-Agent": [
              "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.87 Safari/537.36",
                      "Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_2 like Mac OS X) AppleWebKit/601.1 (KHTML, like Gecko) CriOS/53.0.2785.109 Mobile/14A456 Safari/601.1.46"
            ]
          }
        },
        "response": {
          "version": "1.1",
          "status": "200",
          "reason": "OK",
          "headers": {
            "Content-Type": ["text/html", "application/x-javascript"],
            "Transfer-Encoding": ["chunked"]
          }
        }
      }
    },
    "kcpSettings": {
      "mtu": 1350,
      "tti": 20,
      "uplinkCapacity": 5,
      "downlinkCapacity": 20,
      "congestion": false,
      "readBufferSize": 1,
      "writeBufferSize": 1,
      "header": {
        "type": "none"
      }
    }
  }
}

Client:

{
  "log": {
    "loglevel": "warning"
  },
  "inbound": {
    "port": 1080,
    "listen": "0.0.0.0",
    "protocol": "socks",
    "settings": {
      "auth": "noauth",
      "udp": false,
      "ip": "0.0.0.0"
    }
   },
  "outbound": {
    "protocol": "vmess",
    "settings": {
      "vnext": [
        {
          "address": "_Server-IP_",
          "port": 80,
          "users": [
            {
              "id": "_UUID_",
              "alterId": 256
            }
          ]
        }
      ]
    },
    "streamSettings": {
      "network": "tcp",
      "security": "none",
      "tcpSettings": {
        "connectionReuse": true,
        "header": {
          "type": "http",
          "request": {
            "version": "1.1",
            "method": "GET",
            "path": ["/"],
            "headers": {
              "Host": ["www.toutiao.com", "www.baidu.com"],
              "User-Agent": [
                "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.87 Safari/537.36",
                        "Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_2 like Mac OS X) AppleWebKit/601.1 (KHTML, like Gecko) CriOS/53.0.2785.109 Mobile/14A456 Safari/601.1.46"
              ]
            }
          },
          "response": {
            "version": "1.1",
            "status": "200",
            "reason": "OK",
            "headers": {
              "Content-Type": ["text/html", "application/x-javascript"],
              "Transfer-Encoding": ["chunked"]
            }
          }
        }
      }
    }
  },
  "outboundDetour": [
    {
      "protocol": "freedom",
      "settings": {},
      "tag": "direct"
    }
  ],
  "dns": {
    "servers": [
      "8.8.8.8",
      "8.8.4.4",
      "localhost"
    ]
  },
  "routing": {
    "strategy": "rules",
    "settings": {
      "domainStrategy": "IPIfNonMatch",
      "rules": [
        {
          "type": "field",
          "port": "1-52",
          "outboundTag": "direct"
        },
        {
          "type": "field",
          "port": "54-79",
          "outboundTag": "direct"
        },
        {
          "type": "field",
          "port": "81-442",
          "outboundTag": "direct"
        },
        {
          "type": "field",
          "port": "444-65535",
          "outboundTag": "direct"
        },
        {
          "type": "chinasites",
          "outboundTag": "direct"
        },
        {
          "type": "field",
          "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"
          ],
          "outboundTag": "direct"
        },
        {
          "type": "chinaip",
          "outboundTag": "direct"
        }
      ]
    }
  },
  "transport": {
    "tcpSettings": {
      "connectionReuse": true,
      "header": {
        "type": "http",
        "request": {
          "version": "1.1",
          "method": "GET",
          "path": ["/"],
          "headers": {
            "Host": ["www.toutiao.com", "www.baidu.com"],
            "User-Agent": [
              "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.87 Safari/537.36",
                      "Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_2 like Mac OS X) AppleWebKit/601.1 (KHTML, like Gecko) CriOS/53.0.2785.109 Mobile/14A456 Safari/601.1.46"
            ]
          }
        },
        "response": {
          "version": "1.1",
          "status": "200",
          "reason": "OK",
          "headers": {
            "Content-Type": ["text/html", "application/x-javascript"],
            "Transfer-Encoding": ["chunked"]
          }
        }
      }
    },
    "kcpSettings": {
      "mtu": 1350,
      "tti": 20,
      "uplinkCapacity": 5,
      "downlinkCapacity": 20,
      "congestion": false,
      "readBufferSize": 1,
      "writeBufferSize": 1,
      "header": {
        "type": "none"
      }
    }
  }
}
@ToutyRater
Copy link
Contributor

是的,我也遇到了跟你一样的情况,一开始我还以为我操作不对。我也疑惑到底是在伪装HTTP的实现上出了问题,还是配置写得不对

@v2ray
Copy link
Collaborator

v2ray commented Nov 7, 2016

已确认是个问题,会在今天晚些时候发一个新版本。

@husy8
Copy link
Contributor Author

husy8 commented Nov 7, 2016

@v2ray 多谢

@husy8 husy8 closed this as completed Nov 7, 2016
3gZ2jA pushed a commit to 3gZ2jA/v2ray-core that referenced this issue Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants