github.com/LagrangeDev/LagrangeGo@v0.0.0-20240512064304-ad4a85e10cb4/client/packets/highway/HighWayUrl.go (about)

     1  package highway
     2  
     3  import (
     4  	"encoding/hex"
     5  
     6  	"github.com/LagrangeDev/LagrangeGo/internal/proto"
     7  
     8  	"github.com/LagrangeDev/LagrangeGo/client/packets/pb/action"
     9  )
    10  
    11  func BuildHighWayUrlReq(tgt []byte) ([]byte, error) {
    12  	return proto.Marshal(&action.HttpConn0X6Ff_501{
    13  		HttpConn: &action.HttpConn{
    14  			Field1:       0,
    15  			Field2:       0,
    16  			Field3:       16,
    17  			Field4:       1,
    18  			Tgt:          hex.EncodeToString(tgt),
    19  			Field6:       3,
    20  			ServiceTypes: []int32{1, 5, 10, 21},
    21  			Field9:       2,
    22  			Field10:      9,
    23  			Field11:      8,
    24  			Ver:          "1.0.1",
    25  		},
    26  	})
    27  }
    28  
    29  func ParseHighWayUrlReq(data []byte) (req action.HttpConn0X6Ff_501Response, err error) {
    30  	err = proto.Unmarshal(data, &req)
    31  	return
    32  }