client,proxy: add a media channel

This commit is contained in:
KokaKiwi 2025-08-09 14:11:54 +02:00
parent 70974640ab
commit 0a7291e90f
No known key found for this signature in database
GPG key ID: FD333F84686EFE78
3 changed files with 70 additions and 0 deletions

View file

@ -1,7 +1,9 @@
package snowflake_client
import (
"crypto/rand"
"log"
"math/big"
"time"
)
@ -69,3 +71,12 @@ func (b *bytesSyncLogger) addOutbound(amount int64) {
func (b *bytesSyncLogger) addInbound(amount int64) {
b.inboundChan <- amount
}
func randomInt(min, max int) int {
nBig, err := rand.Int(rand.Reader, big.NewInt(int64(max-min)))
if err != nil {
panic(err)
}
return int(nBig.Int64()) + min
}