func Start(uris []string, token string) error {
	if auth.IsConfigured() && token == "" {
		return fmt.Errorf("An authenticator has been specified but no token provided!\n")
	}
	authtoken = token
	errChan := make(chan error, len(uris))
	for i := range uris {
		url, err := url.Parse(uris[i])
		if err != nil {
			return err
		}
		serversTex.RLock()
		server, ok := servers[url.Scheme]
		serversTex.RUnlock()
		if !ok {
			lumber.Error("Unsupported scheme '%s'", url.Scheme)
			continue
		}
		lumber.Info("Starting '%s' server...", url.Scheme)
		go server(url.Host, errChan)
	}
	select {
	case err := <-errChan:
		lumber.Error("Failed to start - %s", err.Error())
		return err
	case <-time.After(time.Second * time.Duration(len(uris))):
	}
	for err := range errChan {
		lumber.Error("Server error - %s", err.Error())
	}
	return nil
}
Start attempts to individually start mist servers from a list of provided
listeners; the listeners provided is a comma delimited list of uri strings
(scheme:[//[user:pass@]host[:port]][/]path[?query][#fragment])
package server
import (
	"fmt"
	"net/url"
	"sync"
	"time"
	"github.com/jcelliott/lumber"
	"github.com/nanopack/mist/auth"
)
var (
	ErrNotImplemented = fmt.Errorf("Error: Not Implemented\n")
	servers    = map[string]handleFunc{}
	serversTex sync.RWMutex
	authtoken string  
)
type (
	handleFunc func(uri string, errChan chan<- error)
)
func Register(name string, auth handleFunc) {
	serversTex.Lock()
	servers[name] = auth
	serversTex.Unlock()
}