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'm trying to connect to discord's qrcode server via websockets but something in tungstenite or the packages it depends on is making the server throw a 403.
I don't have enough knowledge to debug this and figure out what is happening so i thought i would share it here.
Discord doesn't do anything sophisticated to protect the service. Setting "origin" to "htttps://discord.com" is enough And no, i'm not trying to create qrcodes to scam people. i'm trying to implement qr code login in my custom client to make the login process more convenient.
I don't really know what more information i need to give because i don't know what is happening. but if anyone wants more specific information i would be happy to try and help.
Anyways, here are some snippets that may or may not be useful and sorry for the vague description. i really don't know what's going on.
Code
The code i ran using the websocket crate
use websocket::ClientBuilder;fnmain(){
env_logger::init();letmut client = ClientBuilder::new("wss://remote-auth-gateway.discord.gg/?v=1").unwrap().origin("https://discord.com".to_string()).connect(None).unwrap();let response = client.recv_message().unwrap();println!("{:?}", response);}
Ok, the issue is caused by the Origin header. Some poorely-built servers expect case-sensitive headers. This issue has been mentioned a couple of times and has recently been fixed for Origin header here: #287
But the new version with the fix has not yet been released.
I'm going to release a new version. Meanwhile you can try to use the version from master:
I'm trying to connect to discord's qrcode server via websockets but something in tungstenite or the packages it depends on is making the server throw a 403.
I don't have enough knowledge to debug this and figure out what is happening so i thought i would share it here.
I was able to get the connection to work using the deprecated websocket crate and i was also able to run this python project that does the same thing using the websocket-client pip package
Discord doesn't do anything sophisticated to protect the service. Setting "origin" to "htttps://discord.com" is enough
And no, i'm not trying to create qrcodes to scam people. i'm trying to implement qr code login in my custom client to make the login process more convenient.
I don't really know what more information i need to give because i don't know what is happening. but if anyone wants more specific information i would be happy to try and help.
Anyways, here are some snippets that may or may not be useful and sorry for the vague description. i really don't know what's going on.
Code
The code i ran using the websocket crate
Info
cargo.toml
System information:
Outputs
Output with RUST_LOG=trace & native-tls (it's the same with "native-tls-vendored")
Output with RUST_LOG=trace & rustls-tls-native-roots (warning: very big.) (same with rustls-tls-webpki-roots)
The verbose output from the python project
The text was updated successfully, but these errors were encountered: