in proxy/protocol/http/http_server.go [63:86]
func (hs *httpServer) Start() error {
host, port, err := net.SplitHostPort(hs.opts.Address)
if err != nil {
return err
}
ip := net.ParseIP(host)
if ip == nil {
return fmt.Errorf("IP format error, input is [%s]", hs.opts.Address)
}
if ip.To4() == nil {
return fmt.Errorf("only support ipv4, input is [%s]", hs.opts.Address)
}
switch runtime.Role {
case common.RoleSidecar:
err = hs.startSidecar(host, port)
default:
err = hs.startCommonProxy()
}
if err != nil {
return err
}
return nil
}