mirror of
https://github.com/HeyPuter/puter.git
synced 2026-08-14 18:19:07 +00:00
This extensions brings back the dev-socket functionality, which is really important when testing things like broadcast, alarms, events, etc ; it saves a lot of time if you can invoke a command directly to the backend. This is an optional extension that will not be included in production deployments. This is for development purposes only.
1.1 KiB
1.1 KiB
Backend - dev socket
The "dev socket" allows you to interact with Puter's backend by running commands.
It's a UNIX socket that lets you run commands registered with
CommandService (e.g. help, logs:indent, params:get, etc.).
Enabling the dev socket
The dev socket is provided by the dev-console extension and is opt-in. To enable it:
- Set the environment variable
DEVCONSOLE=1when starting Puter (e.g.npm run devalready does this). - The extension lives in
extensions/dev-console/and registers adev-socketservice whenDEVCONSOLE=1.
Socket location
The socket is created in a directory chosen as follows (in order):
PUTER_DEV_SOCKET_DIRif set./volatile/runtimeif it exists (typical local dev)- otherwise the process current working directory
The socket file is named dev.sock.
Connecting
When in that directory, connect with your tool of choice. For example, using nc and rlwrap for readline history:
rlwrap nc -U ./dev.sock
If it is successful you will see a message with instructions. Enter a command (e.g. help) and press Enter.