mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 02:12:23 +00:00
rpc: url.Parse can't parse filepath in windows
This commit is contained in:
parent
30bdf817a0
commit
55c20d2872
1 changed files with 8 additions and 0 deletions
|
|
@ -27,6 +27,7 @@ import (
|
|||
"net/url"
|
||||
"os"
|
||||
"reflect"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
|
|
@ -177,6 +178,13 @@ func DialContext(ctx context.Context, rawurl string) (*Client, error) {
|
|||
case "":
|
||||
return DialIPC(ctx, rawurl)
|
||||
default:
|
||||
if runtime.GOOS == "windows" && len(u.Scheme) == 1 {
|
||||
for s := 'a'; s <= 'z'; s++ {
|
||||
if rune(u.Scheme[0]) == s {
|
||||
return DialIPC(ctx, rawurl)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil, fmt.Errorf("no known transport for URL scheme %q", u.Scheme)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue