blob: 1286cf67ad7bba07a69b5c28d8434e914108e7a0 [file] [log] [blame]
Suharsh Sivakumar7e93ce52015-05-07 17:46:13 -07001// Copyright 2015 The Vanadium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// +build !nacl
6
7package websocket
8
9import (
10 "net"
11)
12
13// Resolve performs a DNS resolution on the provided protocol and address.
14func Resolve(protocol, address string) (string, string, error) {
15 tcp := mapWebSocketToTCP[protocol]
16 tcpAddr, err := net.ResolveTCPAddr(tcp, address)
17 if err != nil {
18 return "", "", err
19 }
20 return "ws", tcpAddr.String(), nil
21}