mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 10:34:01 +03:00
Merge pull request #379 from 9seconds/fix-telegram-ips
Show ip of telegram endpoints in event stream
This commit is contained in:
+8
-1
@@ -259,9 +259,16 @@ func (p *Proxy) doTelegramCall(ctx *streamContext) error {
|
||||
ctx: ctx,
|
||||
}
|
||||
|
||||
telegramHost, _, err := net.SplitHostPort(foundAddr.Address)
|
||||
if err != nil {
|
||||
conn.Close() //nolint: errcheck
|
||||
|
||||
return fmt.Errorf("cannot parse telegram address %s: %w", foundAddr.Address, err)
|
||||
}
|
||||
|
||||
p.eventStream.Send(ctx,
|
||||
NewEventConnectedToDC(ctx.streamID,
|
||||
conn.RemoteAddr().(*net.TCPAddr).IP, //nolint: forcetypeassert
|
||||
net.ParseIP(telegramHost),
|
||||
ctx.dc),
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user