You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I trying to connect the client to my telegram DC proxy,
I created the public key and the DCList, but the client doesn't run - it is just stuck on RUN with no error...
What I tried:
var spkiPem = -----BEGIN RSA PUBLIC KEY-----
MY PUBLIC KEY
-----END RSA PUBLIC KEY-----`
// Load X.509/SPKI key
spkiBlock, _ := pem.Decode([]byte(spkiPem))
var spkiKey *rsa.PublicKey
spkiKey, err := x509.ParsePKCS1PublicKey(spkiBlock.Bytes)
if err != nil {
log.Fatalln(err)
}
//spkiKey = pubInterface.(*rsa.PublicKey)
domains := make(map[int]string)
domains[0] = "14.15.17.0:443"
dcList := dcs.List{
Options: nil,
Domains: domains,
Test: false,
}
pk := telegram.PublicKey{}
pk.RSA = spkiKey
client := telegram.NewClient(xAppID, xAppHash, telegram.Options{
PublicKeys: []telegram.PublicKey{pk},
DCList: dcList,
})
if err := client.Run(context.Background(), func(ctx context.Context) error { //NOT RUNNING
// It is only valid to use client while this function is not returned
// and ctx is not cancelled.
api := client.API()
//MY CODE HERE
}`
Any hint how to set it correctly will be very helpful
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I trying to connect the client to my telegram DC proxy,
I created the public key and the DCList, but the client doesn't run - it is just stuck on RUN with no error...
What I tried:
var spkiPem =
-----BEGIN RSA PUBLIC KEY-----MY PUBLIC KEY
-----END RSA PUBLIC KEY-----`
}`
Any hint how to set it correctly will be very helpful
thanks
Beta Was this translation helpful? Give feedback.
All reactions