blob: 5a99c23c39909baedc82a74d4e34e8f10c4566d7 [file] [log] [blame]
// Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build !nacl
package websocket
import (
"net"
"v.io/v23/context"
)
// Resolve performs a DNS resolution on the provided protocol and address.
func Resolve(ctx *context.T, protocol, address string) (string, string, error) {
tcp := mapWebSocketToTCP[protocol]
tcpAddr, err := net.ResolveTCPAddr(tcp, address)
if err != nil {
return "", "", err
}
return "ws", tcpAddr.String(), nil
}