You don’t write any server code when you make multi-user sketches with p5.party, but a server is used to synchronize shared objects and broadcast events. Because there is no sketch-specific code running on the server, a single server can support many different p5.party sketches at once, each doing their own thing. What server should you use? You have a few options, depending on your needs.
When you are first starting out, it is easiest to connect to the p5.party example server. This is the server used by the p5.party examples.
wss://demoserver.p5party.org
This is the easiest way to get started and for quick throw-away prototypes, but don’t count on the server being around for long term. Someday it might move to a new url, have an unplanned outage, or go offline forever. Fortunately, setting up your own server and switching to it isn’t that hard.
If you are learning p5.party as part of an organized class, your instructor might have set up a server for just your class to use. If that is the case, you should get the url for the server from them.
If you are instructor using p5.party, consider setting up your own server for your class. Setting up your own server on Heroku takes only a few minutes and a free “hobby dyno” is more than powerful enough to host even larger classes.
If you need long term stability, you might want to set up your own server.
A single deepstream.io server can support many p5.party sketches. This makes sketching and prototyping much faster by avoiding the need to set up a server for each idea. This can especially help in classes and workshops because all of the students can share one server.
When your sketch connects to the server, it provides an app name so the server knows which app is which.
When you create a new p5.party sketch, you'll need to pick a name for the sketch. The server will use the name to know which clients are using your sketch and to keep YOUR sketch's data separate from OTHER sketch's data.
You set the app name when you call partyConnect()
.