cjongseok / mtproto

Telegram MTProto and its proxy (over gRPC) in Go (golang). API Layer: 71
Apache License 2.0
151 stars 20 forks source link

connect failure: Handshaking Failure: missing port in address #14

Closed Pablohn26 closed 5 years ago

Pablohn26 commented 6 years ago

Hi,

I am trying to start a mtproto proxy. I am using docker image and I am trying to launch it using the following command:

docker run -p 11011:11011 -v /root/mtproto/:/opt cjongseok/mtprotod start --port 11011 --addr 149.154.167.40:443 --apiid 20XXXX --apihash 95XXXXXXc1af049ad8cXXXXXX93eXXXX --phone +346XXXXXXXX --secrets /opt/cacert.pem

I have tried with "Test configuration" and "Production configuration" ips, with and without the port.

The complete trace is the following:

root@host:~/mtproto# docker run -p 11011:11011 -v /root/mtproto/:/opt cjongseok/mtprotod start --port 11011 --addr 149.154.167.XX:443  --apiid 20XXXX-apihash 95XXXXXXc1af049ad8cXXXXXX93eXXXX --phone +346XXXXXXXX --secrets /opt/cacert.pem
2018/06/19 15:00:17 [MM 669056947] start
2018/06/19 15:00:17 [MM 669056947] loadsession of  +346XXXXXXXX
2018/06/19 15:00:17 [MM 669056947] connect failure: Handshaking Failure: address aTTveB2GazTw
Efzk2DWgkBluml8OREmvfraX3bkHZJTKX4EQSjBbbdJ2ZXIsRrYOXfaA+xayEGB+
8hdlLmAj: missing port in address
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x97af92]

goroutine 6 [running]:
github.com/cjongseok/mtproto.(*Session).close(0xc42017e1e0)
        /Users/jongseok/gopath/src/github.com/cjongseok/mtproto/session.go:108 +0x72
github.com/cjongseok/mtproto.(*Manager).manageRoutine.func2(0xc420176240, 0xdaea40, 0xc4201c09c0)
        /Users/jongseok/gopath/src/github.com/cjongseok/mtproto/manager.go:300 +0x347
created by github.com/cjongseok/mtproto.(*Manager).manageRoutine
        /Users/jongseok/gopath/src/github.com/cjongseok/mtproto/manager.go:281 +0x231

which is the problem? how should I type the --addr ip?

cjongseok commented 6 years ago

@Pablohn26 You need to generate your mtproto credentials file first. Please use keygen. Its usage is

go run tools/keygen/main.go <APIID> <APIHASH> <PHONE> [KEY_NAME]

I think other parameters are ok.