#Plugin Websocket TLS error: native-tls error: The token provided to the function is invalid
58 messages · Page 1 of 1 (latest)
Are you using a self-signed certificate? If so, how did you generate the certificate?
Thank you for you reply. I dont have much experience yet honestly. I have just followed the steps on github repo. I am not sure how to check if I am using a self-signed certificate. Could you help me with that? Thanks!
Where did you get the certificate that you're using for the websocket? If you made it yourself, then it is self-signed.
I think I am definitively missing something. I dont know where to get a certificate or how it works. I didnt see anything related to certificates on the github repo. Just followed the steps. Are they not enough to make it work?
You used wss:// which is a secure websockets connection. The websocket server that is listening on localhost:3000 should have a certificate.
If it doesn't have a certificate, then you should try with ws:// instead. Note the single s.
I did try that actually and I have got a different error: WebSocket protocol error: Handshake not finished
What are you using to host the websocket at localhost:3000?
Just the default tauri app. The main file is super basic.
The plugin doesn't host a websocket, it connects to one.
Shoud I have an independent server to handle the plugin?
Yes.
Oh I see
Do you expect the app to host it's own websocket? What is the use-case here?
Is there any mencion to that anywhere? I think its so basic i wasnt even worth to mention haha I am embarrassed
Yes in this case I only need that app to listen to itself
It's not explicitly written anywhere. It's implied by the "connect". To connect, you need something to connect to.
Is there any docs on creating a server with certificates on tauri?
To my knowledge, there's no plugin for the server side of websockets, only the client. You would have to use a Rust library for it.
There might be a better way to do this. Is the need for websockets due to a JS library you're using?
My app originally uses pusher io and its host online. Now I am trying to create a tauri app from it to run locally with no internet connection so I cant use pusher anymore.
Am I on the right path with this implamentation?
If you're not using pusher's library, then you should be fine without the websockets.
Where does the real-time data come from?
Since there's no internet connection, I mean.
from the client. What I do is to update data on multiple browsers
In this case my first attempt will be to prompt a new window of the app that will reflect the updated data
Oh, so the Tauri app is GUI controls for the data on LAN browsers?
When you say browser, do you mean Firefox/Chrome/Safari/OtherCommonBrowser?
specifically i have a dashboard that triggers data and I need to show that data on a different window that will be use on a different screen
Oh, so this is all intended to be on one computer within the same app, just lots of extra windows?
Different screen, same computer, yes?
Yes in this first attempt
Next I would try to sync different apps on different pcs
But I thinks that is a hole different thing
Synchronising between multiple computers would involve a server of some kind.
So in this case I should have a specific tauri app just for the server? and another for the users app?
Would the server need to have a GUI?
Not really for what I understand the server would be just to make the websockets work right? Sorry I dont know much about this matter. I am using pusher io and that is as close as I got to websockets
Thank you I will give it a try
Does the data that you display to the users need to be manipulated or interacted with by anyone before it gets sent?
Yes all users should see the same data and be able to interact with it
But nobody is expected to be at the server pushing buttons?
No. All the activity is on the clients
Then you don't need a Tauri app for the server, you can just make a WebSocket server in any language you're comfortable working in.
The clients would be Tauri apps that connect to the server.
I see. I think I have a much better understanding of what is going on here.
I really appreciate the time you have spent with me today thank you
No problem. The event API is only compatible with one Tauri app so definitely use the websockets approach.