v2ray / Planning

Deprecated. Please use v2ray-core for feature requests
60 stars 13 forks source link

Protocol (http/https) based Routing #31

Closed S-Tsunemori closed 6 years ago

S-Tsunemori commented 6 years ago

When using Blackhole outbound to block access, there's an option "type": "http" to return a HTTP 403 response. This works great for http requests, browser shows:

You don't have authorization to view this page.
HTTP ERROR 403

but wouldn't work so well for others, for example https requests would get error like

This site can’t provide a secure connection

www.google.com sent an invalid response.
Try running Windows Network Diagnostics.
ERR_SSL_PROTOCOL_ERROR

To workaround this, I had to make a duplication of my routing config (to blackhole) with an addition condition "port": "80" , so only access to port 80 gets HTTP 403. But although 80 is the common port for http, there are http servers out there using other ports.

So, is it possible to add a new routing condition that is protocol based so it matches http requests on non-80 port as well?

Another usage of this kind of routing I can think of is: when using a unsafe network like public WiFi, direct connects for https while proxy for http to protect privacy.

VictoriaRaymond commented 6 years ago

Will be released in 3.32