func (d *Proxy) FromMap(name string, options map[string]string) error {
	var err error
	d.KeyName = name
	d.Listen, err = NewProxyEndpoint(options["listen"])
	if err != nil {
		return err
	}
	d.Destination, err = NewProxyEndpoint(options["connect"])
	if err != nil {
		return err
	}
	return nil
}
FromMap loads assigned name (can be empty) and options
package device  
import (
	"fmt"
	"strconv"
	"strings"
	"github.com/juju/errors"
)
const (
	ProxyType = "proxy"
)
type Proxy struct {
	KeyName     string
	Listen      *ProxyEndpoint
	Destination *ProxyEndpoint
}
func (d *Proxy) getName() string {
	var name string
	switch {
	case d.KeyName != "":
		name = d.KeyName
	default:
		name = fmt.Sprintf("%v-%v", ProxyType, d.Listen.String())
	}
	return name
}
func (d *Proxy) ToMap() (string, map[string]string) {
	return d.getName(), map[string]string{
		"type":    ProxyType,
		"listen":  d.Listen.String(),
		"connect": d.Destination.String(),
	}
}
func (d *Proxy) new() Device {
	return &Proxy{}
}