mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 21:24:01 +03:00
Direct proxy works
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
package rpc
|
||||
|
||||
import "bytes"
|
||||
|
||||
// HandshakeRequest is the data type which is responsible for
|
||||
// constructing of correct handshake request.
|
||||
type HandshakeRequest struct {
|
||||
}
|
||||
|
||||
// Bytes returns serialized handshake request.
|
||||
func (r *HandshakeRequest) Bytes() []byte {
|
||||
buf := &bytes.Buffer{}
|
||||
buf.Grow(len(TagHandshake) + len(HandshakeFlags) + len(HandshakeSenderPID) + len(HandshakePeerPID))
|
||||
|
||||
buf.Write(TagHandshake) // nolint: gosec
|
||||
buf.Write(HandshakeFlags) // nolint: gosec
|
||||
buf.Write(HandshakeSenderPID) // nolint: gosec
|
||||
buf.Write(HandshakePeerPID) // nolint: gosec
|
||||
|
||||
return buf.Bytes()
|
||||
}
|
||||
|
||||
// NewHandshakeRequest creates new HandshakeRequest instance.
|
||||
func NewHandshakeRequest() *HandshakeRequest {
|
||||
return &HandshakeRequest{}
|
||||
}
|
||||
Reference in New Issue
Block a user