-
Notifications
You must be signed in to change notification settings - Fork 124
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
[BUG] Websocket not working #107
Comments
Hi @PastaGringo Thanks for the well written bug report! I will look into it later this weekend. |
Hi @tobychui, You're welcome, Zoraxy seems very promising! I don't have much information on the reverse proxy settings needed for a Nostr Relay, I think it's pretty basic. I wrote an article on how to self-host our Relay with Nginx Proxy Manager (here) but I didn't had to modify any setting in NPM except checking the option "websockets support" : I will check into my NPM data today what setting it's applying to the proxy. Thanks |
I checked the configration file from my nostr proxy with Nginx Proxy Manager.
Here is the complete nginx file:
|
- Removed Go HTTP client UA - Added optional bypass of websocket origin check #107 - Added basic forward proxy for debug - Fixed UI error in network utils tab
I tried to fix it by adding an optional bypass in the origin checking for the websocket proxy. Currently this settings can only be changed in config file, so if you want to test it out asap, you can modify the following line in the config file with the v3.0.1 (require build from source) {
"ProxyType": 1,
"RootOrMatchingDomain": "test.localhost",
"Domain": "192.168.1.120",
"RequireTLS": false,
"BypassGlobalTLS": false,
"SkipCertValidations": false,
"SkipWebSocketOriginCheck": true, //Default this is false, change this to true and restart zroaxy
"VirtualDirectories": [],
"UserDefinedHeaders": [],
"RequireBasicAuth": false,
"BasicAuthCredentials": [],
"BasicAuthExceptionRules": [],
"DefaultSiteOption": 0,
"DefaultSiteValue": "",
"Disabled": false
} UI elements will be added later after I fixed a few more things in coming weeks. |
@PastaGringo The latest commit on v3.0.1 is running in debug mode, all the web files are not packed into the executable to reduce compile time. |
Thanks @tobychui. I succeed to get back the web UI by copying "web" to its local docker zoraxy config folder:
I could also have done with:
I created the Proxy Rule as before, set the parameter "SkipWebSocketOriginCheck" to true, restarted Zoraxy and the websocket is now available 👍 : I will stay on the version v3.0.1 because I need the websocket working, I will let you know if I found new bugs! Thanks for your help! (please come on Nostr, I will zap you few sats ⚡ to thank you!) |
Is this feature available through webui now? |
@chatainsim If an issue is closed, which means it is already available in the current build or it will not be fixed (usually with a won't fix label). If you have issues on websocket, feel free to create a new issue. |
Hi @tobychui no issue here. Just to know if we still need to edit file directly or if there is now a checkbox or a switch to activate web socket. Thanks |
Websocket is now automated with a check box for Websocket origin check. But in 90% of casual self hosting use cases you can leave that setting to Zoraxy default. |
Describe the bug
Websocket is not working
To Reproduce
Steps to reproduce the behavior:
I just created a new proxy rule for my nostr relay which listen for clients through a websocket :
![Capture d’écran 2024-03-08 à 16 15 35](https://private-user-images.githubusercontent.com/16828964/311276094-55e1c9f7-7819-4493-917f-eae5a9e5fcc1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjExMzI3MTAsIm5iZiI6MTcyMTEzMjQxMCwicGF0aCI6Ii8xNjgyODk2NC8zMTEyNzYwOTQtNTVlMWM5ZjctNzgxOS00NDkzLTkxN2YtZWFlNWE5ZTVmY2MxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE2VDEyMjAxMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTAxZDA2NWZhOWU2NjE5NWZmYzMxMGU5OTE1MGVjMDNhYjViMzczZTcyNTM1NWQ0OGZlODE4MjkxMDM0NzAyODgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.DprBcnbVzBWS-FeZA-9ZEP-Gnso4QzoMiVR7DFb7LFw)
I saw in another post issue that it may concern the Custom Headers (Upgrade) but I didn't find any in its setting:
![Capture d’écran 2024-03-08 à 16 17 59](https://private-user-images.githubusercontent.com/16828964/311276667-3b243acc-0060-4d7a-81a5-fd41094de5fa.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjExMzI3MTAsIm5iZiI6MTcyMTEzMjQxMCwicGF0aCI6Ii8xNjgyODk2NC8zMTEyNzY2NjctM2IyNDNhY2MtMDA2MC00ZDdhLTgxYTUtZmQ0MTA5NGRlNWZhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE2VDEyMjAxMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTE0YjRkYjIwY2NmNjA2MTM5YWU3ZWQwNDZkYTkzMzdlMTcwZWUyNTM3YTVkZDk4NTI2ZGFkN2JkN2E0NDM4MDEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.0sokH5S0HR3O4F4ZOBm-PFQB_ItfSJqQdLk4ftAjoPI)
The https service is working as you can see: https://nostr.fractalized.net
But when I try open the wss://nostr.fractalized.net websocket with websocketking.com it fails with error message : "Could not connect to "wss://nostr.fractalized.net". You may be able to find more information using Inspector/Dev Tools on this page."
When I check the Inspector/Dev Tools from Chrome (Arc Browser in fact, but tried with Chome, Brave and Firefox. Result si the same.) I can see:
I have the same result if I use the website nostr.watch that verify NOSTR relay connectivity in live : https://nostr.watch/relay/nostr.fractalized.net
I can see this LOG message from Zoraxy docker live log:
2024/03/08 15:36:05 websocketproxy: couldn't upgrade websocket: request origin not allowed by Upgrader.CheckOrigin
Do I need to configure something manually to allow websockets on Proxy Rule ?
Thanks for your help!
Host Environment (please complete the following information):
Zoraxy running with docker compose:
Version 3.0.0
Build Release
Running Since 8 Mar 2024 15:38:40 ( 21 minutes, 40 seconds ago)
ZeroTier Linked Link Error
Enable SSH Loopback Disabled
The text was updated successfully, but these errors were encountered: