|
Forum Index : Microcontroller and PC projects : BasicBasic Visual Designer Studio
| Author | Message | ||||
| Batteryman Regular Member Joined: 05/04/2016 Location: United KingdomPosts: 48 |
Hi I'll continue the BBVDS using this new topic: Just to see the web socket working on in brave using BBVDS Download this: Web-Socket_Test_Brave_.vbproj.json.zip If this works, then try this example for your project: Web-Socket_Test_Andoid_.vbproj.json.zip Peter |
||||
| Batteryman Regular Member Joined: 05/04/2016 Location: United KingdomPosts: 48 |
BASICBasic Visual Designer Studio Sorry I forgot to send you the link tom_g Peter |
||||
| tom_g Regular Member Joined: 21/02/2023 Location: SwitzerlandPosts: 44 |
Peter, thanks a lot for the provided files. WS between BBVDS and websocket.org works. WS between BBVDS and "socket tool" test app: I do not get to work the ws server from the test app ("socket tool" by Star Soft) Setup of ws in the test server: binding IP 127.0.0.1 (localhost) on port 8080 I am unshure how to define the web socket path of the server (I used ws://127.0.0.1) Can you please give me a last hint ? (I will not continue to bother you after this last request, as I really do not have enough knowledge in this domain ...) Thank you, and with best regards: Thomas |
||||
| Batteryman Regular Member Joined: 05/04/2016 Location: United KingdomPosts: 48 |
Hi tom_g Ok, we shall give up yet...! The fact that wss://echo.websocket.org worked is a major breakthrough: it proves that BasicBasicVDS, your Socket control, and Brave’s WebSocket engine on your tablet are all 100% operational. So the main focus is on the Star Soft app i think? You may have this all setup correctly, but just a check! 1. The usual check for "Path" Mistake in Socket Tool (Server Setup) In your WebSocket server apps (Star Soft): The "Path" field in the server setup must be just / (a single forward slash) or left blank. By entering ws://127.0.0.1 into the path field, the server was listening on ws://127.0.0.1:8080/ws://127.0.0.1. When BasicBasic tried to connect to ws://127.0.0.1:8080/, the handshake was rejected with a 404/Bad Request. Correct "Socket Tool" Server Settings: Role / Mode: WebSocket Server Binding IP: 0.0.0.0 (binds to all interfaces, which is much more reliable on Android than 127.0.0.1) or 127.0.0.1 Port: 8080 Path / URI: / (just a single slash) Tap Start / Listen in Socket Tool. 2. The HTTPS → ws:// Mixed-Content Blocker in Brave This is why wss://echo.websocket.org worked but ws://127.0.0.1 failed: echo.websocket.org uses wss:// (encrypted SSL/TLS), so Brave allows it without hesitation. 127.0.0.1 uses ws:// (unencrypted plain text). Because BasicBasicVDS is running over HTTPS, Brave strictly blocks unencrypted background connections by default for security. If this happens, your Socket1.LastError in BasicBasic will report: "This page is secure (https), so the browser blocks plain ws:// links. Use wss:// or the desktop app." How you can fix this in Brave on Android: Tap the Brave Shields (lion icon) in the address bar while on BBVDS site → turn Shields OFF for the site. Tap the padlock / tune icon in the address bar → Permissions / Site settings → change Insecure content (or "Mixed content") to Allow. Reload the BasicBasic page. Ohin the Button1.Action editor: ' Button1.Action (Connect) Socket1.Host = "127.0.0.1" Socket1.Port = 8080 Socket1.Protocol = "WebSocket" Label1.Text = "Connecting to local tool..." Socket1.Connect (Note: If Socket Tool is bound to a specific path like /ws, you can simply set Socket1.Host = "127.0.0.1/ws"). And in Socket1.Error: Label1.Text = "Error: " & Socket1.LastError This error label will immediately tell you if Brave is blocking the connection or if the port was refused. I'm happy to keep going until we get to the point where Brave has a vulnerability security issue, which in today's climate is quite understandable! I can update the my file here and upload in the next post for the above VB suggestions Peter |
||||
| tom_g Regular Member Joined: 21/02/2023 Location: SwitzerlandPosts: 44 |
Good evening Peter, I am sorry, still no success. I did follow all the steps you have described so well, but simply get the "Error: Could not connect to ws://127.0.0.1:8080" in BBVDS as socket last error notification. Maybe an issue with Socket tool ? And as you mentioned, I am afraid from consequences due to lowering safety margins in Brave browser. I am sorry, spent too much time and have to give it up now ... As you have explained the behaviour I have learnt quite a bit about web sockets topic and want to thank you very much for your help and patience. Let me express my respect for your knowledge and work, with my best wishes Thomas |
||||
| Batteryman Regular Member Joined: 05/04/2016 Location: United KingdomPosts: 48 |
Hi Thomas, It's been a pleasure to look into this for you, I'll keep looking into it myself as a challenge! Just a quick question, are you using this Web socket tool for other projects that work OK? If so give me details if your happy to. If I do get it working on my side using Star Soft then I'll post it here and add to help guide. Hopefully you will keep an eye on here to pick it up. Best regards Peter |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2026 |