mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-09-01 09:14:01 +03:00
Now it is a time to start to make a handshake
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
package mtproto
|
||||
|
||||
type Extras struct {
|
||||
QuickAck bool
|
||||
SimpleAck bool
|
||||
}
|
||||
@@ -4,3 +4,8 @@ const (
|
||||
RPCNonceSeqNo = -2
|
||||
RPCHandshakeSeqNo = -1
|
||||
)
|
||||
|
||||
type Extras struct {
|
||||
QuickAck bool
|
||||
SimpleAck bool
|
||||
}
|
||||
|
||||
@@ -28,8 +28,8 @@ type RPCProxyRequest struct {
|
||||
RemoteIPPort [rpcProxyRequestIPPortLength]byte
|
||||
LocalIPPort [rpcProxyRequestIPPortLength]byte
|
||||
ADTag []byte
|
||||
Extras Extras
|
||||
Message *bytes.Buffer
|
||||
Extras *mtproto.Extras
|
||||
}
|
||||
|
||||
func (r *RPCProxyRequest) Bytes() []byte {
|
||||
@@ -65,7 +65,7 @@ func (r *RPCProxyRequest) Bytes() []byte {
|
||||
return buf.Bytes()
|
||||
}
|
||||
|
||||
func NewRPCProxyRequest(connectionType mtproto.ConnectionType, local, remote *net.TCPAddr, adTag []byte, extras *mtproto.Extras) (*RPCProxyRequest, error) {
|
||||
func NewRPCProxyRequest(connectionType mtproto.ConnectionType, local, remote *net.TCPAddr, adTag []byte, extras Extras) (*RPCProxyRequest, error) {
|
||||
flags := RPCProxyRequestFlagsHasAdTag | RPCProxyRequestFlagsMagic | RPCProxyRequestFlagsExtMode2
|
||||
|
||||
switch connectionType {
|
||||
|
||||
+7
-1
@@ -8,13 +8,15 @@ import (
|
||||
"go.uber.org/zap"
|
||||
|
||||
"github.com/9seconds/mtg/config"
|
||||
"github.com/9seconds/mtg/mtproto"
|
||||
"github.com/9seconds/mtg/wrappers"
|
||||
)
|
||||
|
||||
type middleTelegram struct {
|
||||
middleTelegramCaller
|
||||
}
|
||||
|
||||
func NewMiddleTelegram(conf *config.Config, logger *zap.SugaredLogger) *middleTelegram {
|
||||
func NewMiddleTelegram(conf *config.Config, logger *zap.SugaredLogger) Telegram {
|
||||
tg := &middleTelegram{
|
||||
middleTelegramCaller: middleTelegramCaller{
|
||||
baseTelegram: baseTelegram{
|
||||
@@ -35,3 +37,7 @@ func NewMiddleTelegram(conf *config.Config, logger *zap.SugaredLogger) *middleTe
|
||||
|
||||
return tg
|
||||
}
|
||||
|
||||
func (t *middleTelegram) Init(connOpts *mtproto.ConnectionOpts, conn wrappers.ReadWriteCloserWithAddr) (wrappers.ReadWriteCloserWithAddr, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user