Equim-chan / h2s

:electric_plug: A simple tool that wraps HTTPS proxies into a SOCKS5 proxy.
MIT License
122 stars 19 forks source link

h2s: serve: handshake upstream: 403 Access violation #6

Closed loongwind closed 4 years ago

loongwind commented 5 years ago

配置如下:

{
  "log": {
    "loglevel": "debug"
  },
  "inbounds": [{
    "port": 1090,
    "listen": "127.0.0.1",
    "tag": "socks-inbound",
    "protocol": "socks",
    "settings": {
      "auth": "noauth",
      "udp": false,
      "ip": "127.0.0.1"
    }
  }],
  "outbound": 
  {
    "protocol": "vmess",
    "settings": {
      "vnext": [
        {
          "address": "x.x.x.x", 
          "port": 8888,
          "users": [
            {
              "id": "c5f1ecdb-07d5-4834-ac30-83433804c8af",  
              "alterId": 64 
            }
          ]
        }
      ]
    },
    "proxySettings": {
      "tag": "h2s"  
    },
    "tag":"proxy"
  },

  "outboundDetour": [
    {
      "protocol": "socks",
      "settings":{
        "servers":[{
          "address":"127.0.0.1",
          "port":3080
        }]
      },
      "tag": "h2s"
    }
  ]
}

v2ray提示:

v2ray.com/core/app/proxyman/inbound: connection ends 
> v2ray.com/core/proxy/socks: connection ends
 > v2ray.com/core/proxy/socks: failed to transport all TCP response 
> io: read/write on closed pipe

h2s提示:

h2s: serve: handshake upstream: 403 Access violation

是哪里配置不对么?

Equim-chan commented 5 years ago

h2s 的配置没有问题吗?上游的 HTTP 代理是不是需要鉴权?

loongwind commented 5 years ago

h2s 的配置没有问题吗?上游的 HTTP 代理是不是需要鉴权?

h2s的配置没问题 直接转发到h2s是没问题的,能正常使用

Equim-chan commented 5 years ago

我怀疑有两种可能:

  1. 上游是只支持 HTTP 的那种代理,不支持 CONNECT 方法
  2. 上游支持 CONNECT 但限制了目标地址或端口

对于第一种,你尝试经过它去连接一个 HTTPS 服务,如果能成功就可以排除。对于第二种,尝试连接一个 80/443 以外的端口看看。