Zikado
Zikado
Explore posts from servers
SSolidJS
Created by Zikado on 3/4/2025 in #support
SolidStart Websocket Proxy
ohh sorry, the thing I wrote regarded this message
Have you tried making connection a module global?

I wonder if the connection is being disposed once the App component has finished setup.
Have you tried making connection a module global?

I wonder if the connection is being disposed once the App component has finished setup.
so I juse tried doing it this way (still with the proxy). Without the proxy it works like a charm. (sorry if I mislead you)
30 replies
SSolidJS
Created by Zikado on 3/4/2025 in #support
SolidStart Websocket Proxy
Now and also before, the result was the same
30 replies
SSolidJS
Created by Zikado on 3/4/2025 in #support
SolidStart Websocket Proxy
I have tried that on Firefox and Brave, the server works well when connecting directly to it (meaning using the server url directly without the proxy)
30 replies
SSolidJS
Created by Zikado on 3/4/2025 in #support
SolidStart Websocket Proxy
in the network panel it just gets stuck on "pending" and in firefox I eventually get that: Firefox was not able to establish connection with ws://localhost:3000/ws. That's it.
30 replies
SSolidJS
Created by Zikado on 3/4/2025 in #support
SolidStart Websocket Proxy
Yes
30 replies
SSolidJS
Created by Zikado on 3/4/2025 in #support
SolidStart Websocket Proxy
I have tried to do that hopefully the way you meant it
import { isServer } from "solid-js/web";

let connection;

if (!isServer) {
connection = new WebSocket("ws://localhost:3000/ws");
connection.onopen = () => {
console.log("OPENED");
};
connection.onmessage = (e) => {
console.log(JSON.stringify(e.data));
};
}

export default function App() {
console.log(connection);
setTimeout(() => {
console.log(connection);
}, 2000);
return <main>Some content</main>;
}
import { isServer } from "solid-js/web";

let connection;

if (!isServer) {
connection = new WebSocket("ws://localhost:3000/ws");
connection.onopen = () => {
console.log("OPENED");
};
connection.onmessage = (e) => {
console.log(JSON.stringify(e.data));
};
}

export default function App() {
console.log(connection);
setTimeout(() => {
console.log(connection);
}, 2000);
return <main>Some content</main>;
}
it behave the same way as before, the connection reference was still available, sorry if I got it wrong
30 replies
SSolidJS
Created by Zikado on 3/4/2025 in #support
SolidStart Websocket Proxy
Thanks for the advice, I'll keep that in mind.
30 replies
SSolidJS
Created by Zikado on 3/4/2025 in #support
SolidStart Websocket Proxy
Okay, thank you for clarifying. I'll will just connect to it directly then 🙂
30 replies
SSolidJS
Created by Zikado on 3/4/2025 in #support
SolidStart Websocket Proxy
Yeah you're probably right, sorry about the stupid questions
30 replies
SSolidJS
Created by Zikado on 3/4/2025 in #support
SolidStart Websocket Proxy
Ohh, okay, I just thought that it would be better not to directly expose the ws server, but to be honest I'm not particularly sure how much of a big deal it is.
30 replies
SSolidJS
Created by Zikado on 3/4/2025 in #support
SolidStart Websocket Proxy
Thanks for the answers, however I'm not really sure what to take away from them. My intention was to run this solid app in serverless environment hence it's not suitable as websocket server for my implementation. That's why I wanted to create the proxy to the standalone server. Do you think that would be feasible? Thank you again.
30 replies
SSolidJS
Created by Zikado on 12/18/2024 in #support
Different server context when using "use server"?
@peerreynders Thank you very much for the response, I will look into it ❤️
5 replies
SSolidJS
Created by Zikado on 12/18/2024 in #support
Different server context when using "use server"?
Oh, ok, thank you for the response, do you have any recommendation how to approach it then, just pick one of these and stick with it?
5 replies
TTCTheo's Typesafe Cult
Created by archer on 1/24/2024 in #questions
Dumb Next question (noob?)
Glad it helped 🙂
7 replies
TTCTheo's Typesafe Cult
Created by archer on 1/24/2024 in #questions
Dumb Next question (noob?)
Not sure how your app has the auth implemented but as far as I know Next automaticaly deduplicates fetch requests (fires it only once and then serves it from the cache) and actually recommends to repeat the fetch queries throughout your app code. So if your main goal is to reduce DB calls this takes care of it.
7 replies
TTCTheo's Typesafe Cult
Created by Zikado on 11/25/2023 in #questions
Compiling user's code - the right way
Thanks for the response, do you have any idea about correct implementation? I have read something about web workers or iframes doing the job connected with some sandboxing library.
4 replies