support unix domain websockets

This commit is contained in:
Ethan Buchman
2016-02-19 02:05:24 +00:00
parent 74130008f7
commit 1410693eae
4 changed files with 70 additions and 18 deletions

View File

@ -86,7 +86,7 @@ type WSRPCContext struct {
// If tcp, must specify the port; `0.0.0.0` will return incorrectly as "unix" since there's no port
func SocketType(listenAddr string) string {
socketType := "unix"
if len(strings.Split(listenAddr, ":")) == 2 {
if len(strings.Split(listenAddr, ":")) >= 2 {
socketType = "tcp"
}
return socketType