Any way to use WSS (secure websockets) with sock.lua?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
Universezero
Prole
Posts: 2
Joined: Tue Dec 24, 2024 1:31 am
Contact:

Any way to use WSS (secure websockets) with sock.lua?

Post by Universezero »

I'm making a game in Love, and I've used sock.lua for the networking. This works fine when the game is running on Windows or Android, but as soon as I host the game on my website using love.js, the networking no longer works since the game is served through a HTTPS website, which blocks any non-secure external websocket connections. I tried to get around this by using nginx as a secure websocket endpoint for my server (i.e. nginx acts as a secure websocket proxy, and hands data to and from the non-secure websocket server running sock.lua on the same machine), however this doesn't seem to work as sock.lua won't connect to the WSS nginx endpoint from the client. Is there any way to get around this, or do I need to use a different library for my game client networking? Is there any easy fix where sock.lua can hand all its data to a library that will then communicate with my WSS endpoint (i.e. I don't need to rewrite all my client-side game logic using a new lua library)?
User avatar
Universezero
Prole
Posts: 2
Joined: Tue Dec 24, 2024 1:31 am
Contact:

Re: Any way to use WSS (secure websockets) with sock.lua?

Post by Universezero »

I've found the below library (love-ws) - looks like it might do the job well, with the downside being I'll need to rewrite all the client and server side code.

https://github.com/holywyvern/love-ws
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 7 guests