func (s *Server) Upgrade(session quic.Session) {
	for {
		fmt.Println("Waiting for stream...")
		stream, err := session.AcceptStream()
		if err != nil {
			fmt.Println("accept stream:", err)
			session.Close(err)
			return
		}
		go s.handleQuictunStream(stream)
	}
}
Upgrade starts using a given QUIC session with the quictun protocol.
The quictun server immediately starts accepting new QUIC streams and assumes
them to speak the quictun protocol (QTP).
The actual protocol upgrade (via a HTTP/2 request-response) is handled
entirely by the web server.
package quictun
import (
	"bufio"
	"fmt"
	"net"
	"strconv"
	"time"
	"github.com/julienschmidt/quictun/internal/socks"
	quic "github.com/lucas-clemente/quic-go"
)
type SequenceCache interface {
	Set(key uint64, value uint32) (old uint32)
	Get(key uint64) (value uint32)
}
type Server struct {
	DialTimeout   time.Duration
	SequenceCache SequenceCache
}
func (s *Server) CheckSequenceNumber(header string) bool {
	if len(header) != 24 {
		return false
	}
	clientID, err := strconv.ParseUint(header[:16], 16, 64)
	if err != nil {
		return false
	}
	sequenceNumber, err := strconv.ParseUint(header[16:], 16, 32)
	if err != nil {
		return false
	}
	return s.SequenceCache.Set(clientID, uint32(sequenceNumber)) < uint32(sequenceNumber)
}