func (s *ProviderServer) CleanUp(domain, token, keyAuth string) error {
	if s.listener == nil {
		return nil
	}
	s.listener.Close()
	<-s.done
	return nil
}
CleanUp closes the HTTP server and removes the token from `ChallengePath(token)`.
package http01
import (
	"fmt"
	"net"
	"net/http"
	"net/textproto"
	"strings"
	"github.com/go-acme/lego/v4/log"
)
type ProviderServer struct {
	iface    string
	port     string
	matcher  domainMatcher
	done     chan bool
	listener net.Listener
}
func NewProviderServer(iface, port string) *ProviderServer {
	if port == "" {
		port = "80"
	}
	return &ProviderServer{iface: iface, port: port, matcher: &hostMatcher{}}
}
func (s *ProviderServer) Present(domain, token, keyAuth string) error {
	var err error
	s.listener, err = net.Listen("tcp", s.GetAddress())
	if err != nil {
		return fmt.Errorf("could not start HTTP server for challenge: %w", err)
	}
	s.done = make(chan bool)
	go s.serve(domain, token, keyAuth)
	return nil
}
func (s *ProviderServer) GetAddress() string {
	return net.JoinHostPort(s.iface, s.port)
}