Add required things for middlehandshake

This commit is contained in:
9seconds
2019-09-10 13:54:14 +03:00
parent 691954bd16
commit 1617866c24
6 changed files with 121 additions and 22 deletions
+1 -7
View File
@@ -10,9 +10,7 @@ import (
"github.com/9seconds/mtg/wrappers"
)
type TelegramProtocol struct{}
func (t *TelegramProtocol) Handshake(req *protocol.TelegramRequest) (wrappers.Wrap, error) {
func TelegramProtocol(req *protocol.TelegramRequest) (wrappers.Wrap, error) {
socket, err := telegram.Direct.Dial(req.Ctx,
req.Cancel,
req.ClientProtocol.DC(),
@@ -39,10 +37,6 @@ func (t *TelegramProtocol) Handshake(req *protocol.TelegramRequest) (wrappers.Wr
return wrappers.NewObfuscated2(socket, encryptor, decryptor), nil
}
func MakeTelegramProtocol() protocol.TelegramProtocol {
return &TelegramProtocol{}
}
func generateFrame(cp protocol.ClientProtocol) (fm Frame) {
data := fm.Bytes()