func (b *Broker) getASocket() (*websocket.Conn, *ApiResponse, error) {
	var req = ApiRequest{
		URL:    `https: 
		Values: make(url.Values),
		Broker: b,
	}
	authResp, err := MakeAPIReq(req)
	if err != nil {
		return nil, nil, err
	}
	if authResp.URL == "" {
		return nil, nil, fmt.Errorf("Auth failure")
	}
	wsURL := strings.Split(authResp.URL, "/")
	wsURL[2] = wsURL[2] + ":443"
	authResp.URL = strings.Join(wsURL, "/")
	Logger.Debug(`Team Wesocket URL: `, authResp.URL)
	var Dialer websocket.Dialer
	header := make(http.Header)
	header.Add("Origin", "http://localhost/")
	ws, _, err := Dialer.Dial(authResp.URL, header)
	if err != nil {
		return nil, nil, fmt.Errorf("no dice dialing that websocket: %v", err)
	}
	return ws, authResp, nil
}
getASocket calls MakeApiRequest() to get a websocket for the slack RTM
interface.
package lib
import (
	"encoding/json"
	"fmt"
	"github.com/fatih/structs"
	"github.com/gorilla/websocket"
	"net/http"
	"net/url"
	"strconv"
	"strings"
)
type ApiRequest struct {
	URL    string
	Values url.Values
	Broker *Broker
}
func MakeAPIReq(req ApiRequest) (*ApiResponse, error) {
	if req.Values.Get(`token`) == `` {
		req.Values.Set(`token`, req.Broker.Config.Token)
	}
	if req.Values.Get(`as_user`) == `` {
		req.Values.Set(`as_user`, req.Broker.Config.Name)
	}
	resp := new(ApiResponse)
	reply, err := http.PostForm(req.URL, req.Values)
	if err != nil {
		return resp, err
	}
	defer reply.Body.Close()
	dec := json.NewDecoder(reply.Body)
	err = dec.Decode(resp)
	if err != nil {
		return resp, fmt.Errorf("Couldn't decode json. ERR: %v", err)
	}
	return resp, nil
}