Discuss Scratch

The_Mad_Punter
Scratcher
100+ posts

How do you get a WSS server?

I gonna use it for scratch games
Ancoder
Scratcher
1000+ posts

How do you get a WSS server?

The_Mad_Punter wrote:

I gonna use it for scratch games
what do you mean
are you going to compile using turbowarp or htmlifier or something?
god286
Scratcher
1000+ posts

How do you get a WSS server?

so you want to make a scratch cloud server? https://github.com/SheepTester/primitive-cloud-server can help you.
SansStudios
Scratcher
1000+ posts

How do you get a WSS server?

If you want to make your own websocket server, you can use the websockets python module.

This does require knowledge of advanced python and python asyncio.

From the documentation:

import asyncio
import websockets
async def echo(websocket):
    async for message in websocket:
        await websocket.send(message)
async def main():
    async with websockets.serve(echo, "localhost", 8765):
        await asyncio.Future()  # run forever
asyncio.run(main())
Chiroyce
Scratcher
1000+ posts

How do you get a WSS server?

SansStudios wrote:

If you want to make your own websocket server, you can use the websockets python module.

The_Mad_Punter wrote:

I gonna use it for scratch games
So they probably need one that is compatible with the Scratch frontend, so what god286 said is the best idea

god286 wrote:

so you want to make a scratch cloud server? https://github.com/SheepTester/primitive-cloud-server can help you.

Step 1 - Make an account on https://replit.com
Step 2 - Click this link and then wait for it to finish loading…
Step 3 - Click on the “.replit” file on the left side

Step 4 - Paste this onto the file
language = "nodejs"
run = "npm install; npm start"
Step 5 - Press run, then wait for this to show up


Done!! Your server is now running! You can close the tab and it will still run, but if it is inactive for over an hour, it'll shut down the server, so you'll have to press run again, If you want it to run 24/7, use uptimerobot's free plan and set a pinger for this url
https://primitive-cloud-server.<YOUR-REPLIT-USERNAME>.repl.co

Your server's websocket URL will be
wss://primitive-cloud-server.<YOUR-REPLIT-USERNAME>.repl.co

also replace <YOUR-REPLIT-USERNAME> with your actual replit username

Last edited by Chiroyce (Jan. 8, 2022 06:07:45)

SansStudios
Scratcher
1000+ posts

How do you get a WSS server?

Chiroyce wrote:

SansStudios wrote:

If you want to make your own websocket server, you can use the websockets python module.

The_Mad_Punter wrote:

I gonna use it for scratch games
So they probably need one that is compatible with the Scratch frontend, so what god286 said is the best idea

god286 wrote:

so you want to make a scratch cloud server? https://github.com/SheepTester/primitive-cloud-server can help you.

OP never specified that they were hosting a version of scratch, only that they needed to “get” a websocket server. It's possible that they just want to get the already existing scratch websocket server, in which case, they could use ScratchConnect + Python.

Last edited by SansStudios (Jan. 8, 2022 22:12:52)

The_Mad_Punter
Scratcher
100+ posts

How do you get a WSS server?

SansStudios wrote:

Chiroyce wrote:

SansStudios wrote:

If you want to make your own websocket server, you can use the websockets python module.

The_Mad_Punter wrote:

I gonna use it for scratch games
So they probably need one that is compatible with the Scratch frontend, so what god286 said is the best idea

god286 wrote:

so you want to make a scratch cloud server? https://github.com/SheepTester/primitive-cloud-server can help you.

OP never specified that they were hosting a version of scratch, only that they needed to “get” a websocket server. It's possible that they just want to get the already existing scratch websocket server, in which case, they could use ScratchConnect + Python.
I'm just making a game, not hosting a Scratch version (like turbowarp).
The_Mad_Punter
Scratcher
100+ posts

How do you get a WSS server?

SansStudios wrote:

If you want to make your own websocket server, you can use the websockets python module.

This does require knowledge of advanced python and python asyncio.

From the documentation:

import asyncio
import websockets
async def echo(websocket):
    async for message in websocket:
        await websocket.send(message)
async def main():
    async with websockets.serve(echo, "localhost", 8765):
        await asyncio.Future()  # run forever
asyncio.run(main())
I do know Python, by the way. However, my RPi won't work.
NFlex23
Scratcher
1000+ posts

How do you get a WSS server?

The_Mad_Punter wrote:

However, my RPi won't work.
Replit
SansStudios
Scratcher
1000+ posts

How do you get a WSS server?

Do you want to make a game that connects to the scratch websocket server, or do you want to host your own websocket server?

Connecting to the scratch websocket server lets you do the following:
- Set/read cloud variables
- Make projects that interface with external api projects (like this one)

Hosting your own websocket server lets you:
- Have a two-way client-server connection that transfers data
The_Mad_Punter
Scratcher
100+ posts

How do you get a WSS server?

I got a WSS server running on Replit (finally). Now it doens't even work. Used Jeffalo's code. And doesn't let me play Griffpatch Cloud Platformer on multiple tabs.
unknownuser-k1390
Scratcher
12 posts

How do you get a WSS server?

Chiroyce wrote:

SansStudios wrote:

If you want to make your own websocket server, you can use the WebSockets python module.

The_Mad_Punter wrote:

I gonna use it for scratch games
So they probably need one that is compatible with the Scratch frontend, so what god286 said is the best idea

god286 wrote:

so you want to make a scratch cloud server? https://github.com/SheepTester/primitive-cloud-server can help you.

Step 1 - Make an account on https://replit.com
Step 2 - Click this link and then wait for it to finish loading…
Step 3 - Click on the “.replit” file on the left side

Step 4 - Paste this onto the file
language = "nodejs"
run = "npm install; npm start"
Step 5 - Press run, then wait for this to show up


Done!! Your server is now running! You can close the tab and it will still run, but if it is inactive for over an hour, it'll shut down the server, so you'll have to press run again, If you want it to run 24/7, use uptimerobot's free plan and set a pinger for this URL
https://primitive-cloud-server.<YOUR-REPLIT-USERNAME>.repl.co

Your server's websocket URL will be
wss://primitive-cloud-server.<YOUR-REPLIT-USERNAME>.repl.co

also replace <YOUR-REPLIT-USERNAME> with your actual replit username

How I do test it? I tried using TurboWarp to package a project and test it but the server does not respond and Uptime Robot says it works normally. Does it need a valid project ID to work?
WojtekGame
Scratcher
1000+ posts

How do you get a WSS server?

unknownuser-k1390 wrote:

Chiroyce wrote:

SansStudios wrote:

If you want to make your own websocket server, you can use the WebSockets python module.

The_Mad_Punter wrote:

I gonna use it for scratch games
So they probably need one that is compatible with the Scratch frontend, so what god286 said is the best idea

god286 wrote:

so you want to make a scratch cloud server? https://github.com/SheepTester/primitive-cloud-server can help you.

Step 1 - Make an account on https://replit.com
Step 2 - Click this link and then wait for it to finish loading…
Step 3 - Click on the “.replit” file on the left side

Step 4 - Paste this onto the file
language = "nodejs"
run = "npm install; npm start"
Step 5 - Press run, then wait for this to show up


Done!! Your server is now running! You can close the tab and it will still run, but if it is inactive for over an hour, it'll shut down the server, so you'll have to press run again, If you want it to run 24/7, use uptimerobot's free plan and set a pinger for this URL
https://primitive-cloud-server.<YOUR-REPLIT-USERNAME>.repl.co

Your server's websocket URL will be
wss://primitive-cloud-server.<YOUR-REPLIT-USERNAME>.repl.co

also replace <YOUR-REPLIT-USERNAME> with your actual replit username

How I do test it? I tried using TurboWarp to package a project and test it but the server does not respond and Uptime Robot says it works normally. Does it need a valid project ID to work?
Don't necropost also thanks for bumping.
unknownuser-k1390
Scratcher
12 posts

How do you get a WSS server?

Error: ENOENT: no such file or directory, stat ‘/home/runner/static/404.html’

How I do fix this?
ScratchCatHELLO
Scratcher
1000+ posts

How do you get a WSS server?

unknownuser-k1390 wrote:

Error: ENOENT: no such file or directory, stat ‘/home/runner/static/404.html’

How I do fix this?

it sounds to me like you asked the server for a page that didn’t exist, it tried to redirect you to the 404 page (page to tell users the page they tried to access doesn’t exist), but then the 404 page didn’t exist either.

Powered by DjangoBB