mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 14:54:01 +03:00
Show real IP of the telegram endpoint 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