Do scheme validation in the client

This commit is contained in:
Audrius Butkevicius
2015-06-28 20:34:28 +01:00
parent f8bedc55e5
commit 6bc6ae2d28
2 changed files with 8 additions and 0 deletions

View File

@@ -52,6 +52,10 @@ type ProtocolClient struct {
}
func (c *ProtocolClient) connect() error {
if c.URI.Scheme != "relay" {
return fmt.Errorf("Unsupported relay schema:", c.URI.Scheme)
}
conn, err := tls.Dial("tcp", c.URI.Host, c.config)
if err != nil {
return err