TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ading2210/sandstone/llms.txt
Use this file to discover all available pages before exploring further.
network module manages all outbound connections made by Sandstone. It holds the singleton libcurl HTTP session used to fetch pages and static assets, tracks active WebSocket connections grouped by frame ID, and exposes the set_websocket function you call to point Sandstone at a Wisp server. You access this module as sandstone.network after importing the host bundle.
Import
Exports
A map of all active WebSocket connections, keyed first by frame ID and then by a per-connection WS ID. Each leaf entry is an object with
ws (the underlying libcurl.CurlWebSocket instance), events (a queue of pending events), and callback (an optional resolver for the current long-poll). You typically do not need to read this directly; it is managed automatically as pages open and close WebSockets.The active libcurl HTTP session, or
null before libcurl has finished loading. The session is created with enable_cookies: true when the libcurl_load event fires, so cookies are shared across all requests made through the same session. Use session.fetch directly for advanced request scenarios, or rely on ProxyFrame.navigate_to which calls it internally.Set the URL of the Wisp WebSocket server that libcurl.js uses to tunnel all proxied traffic. You must call this before the first navigation. Wraps
libcurl.set_websocket(url) directly.Close and remove all WebSocket connections associated with the given frame ID. This is called automatically by
ProxyFrame.navigate_to each time you navigate to a new page, so stale connections from the previous page are cleaned up. You can also call it manually if you need to forcibly tear down connections for a specific frame.The libcurl re-export
sandstone.libcurl re-exports the libcurl.js instance directly, giving you access to the full libcurl.js API for advanced use cases such as making raw fetch requests, creating CurlWebSocket instances, or calling set_websocket directly:
Example
sandstone.network.session is null until the libcurl_load event fires. If you need to make requests before the first ProxyFrame.navigate_to call (which waits for libcurl internally), listen for libcurl_load on sandstone.libcurl.events before accessing session.