Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change ip4 to domain to fix wss in browser #194

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kingofnull
Copy link

On https pages connector switches to WSS but for TLS validation on browsers wss url domain most match certificate domain. I just apply it.

On https pages connector switches to WSS but for TLS validation on browsers wss url domain most match certificate domain. I just apply it.
@painor
Copy link
Member

painor commented Nov 14, 2021

I don't think this is the correct fix for it. In browsers, it should pickup vesta.web.telegram.org as the default URL.
For Node it should be an IP not a URL.

@kingofnull
Copy link
Author

But it doesn't and setting it manually fix the connectivity problem:

    client.session.setDC(4, 'kws4.web.telegram.org', 443);

and I found it from https://web.telegram.org/k/ and it return exact IP as current IP in gramjs config.

I want to help to improve library. Please test library on https web page and if it worked you just ignore this commit.

I built browser build and loaded it to this page (its a https one) you can test connection on it yourself:

https://kingofnull.github.io/gramjs-browser-build/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants