Revert(engine): default scheme

This reverts commit a86608e31a.
This commit is contained in:
xjasonlyu
2021-09-09 12:10:57 +08:00
parent 05f4938053
commit e1ca5069e0

View File

@@ -13,15 +13,15 @@ import (
)
func parseDevice(s string, mtu uint32) (device.Device, error) {
if !strings.Contains(s, "://") {
s = fmt.Sprintf("%s://%s", tun.Driver /* default driver */, s)
}
u, err := url.Parse(s)
if err != nil {
return nil, err
}
if u.Scheme == "" {
u.Scheme = tun.Driver /* default driver */
}
name := u.Host
driver := strings.ToLower(u.Scheme)
@@ -34,15 +34,15 @@ func parseDevice(s string, mtu uint32) (device.Device, error) {
}
func parseProxy(s string) (proxy.Proxy, error) {
if !strings.Contains(s, "://") {
s = fmt.Sprintf("%s://%s", proto.Socks5 /* default protocol */, s)
}
u, err := url.Parse(s)
if err != nil {
return nil, err
}
if u.Scheme == "" {
u.Scheme = proto.Socks5.String() /* default protocol */
}
protocol := strings.ToLower(u.Scheme)
switch protocol {