mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 21:24: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,
|
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,
|
p.eventStream.Send(ctx,
|
||||||
NewEventConnectedToDC(ctx.streamID,
|
NewEventConnectedToDC(ctx.streamID,
|
||||||
conn.RemoteAddr().(*net.TCPAddr).IP, //nolint: forcetypeassert
|
net.ParseIP(telegramHost),
|
||||||
ctx.dc),
|
ctx.dc),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user