UKADOC Project
SSTP/1.x

Reference: SSTP (external site)

At present, DirectSSTP depends heavily on Windows specifications, and implementation on other operating systems is not anticipated.
Since IPC mechanisms also exist on other operating systems, it would be preferable to define a separate specification.
If a specification is established, we plan to publish it separately, so please contact the Ukadoc Project.

Overview

SSTP is a general-purpose communication specification between ghosts. It can be used for simple Sakura Script playback, external event notifications, and similar purposes.
Communication is generally done over TCP/IP. The system listens on port 9801 or 9821 (SSP only). Sending a request according to the SSTP protocol returns the processing result.
For security reasons, unless the settings are changed, it currently listens only on localhost, so communication from outside the device is not possible. Port 11000 was also listened on in the past, but it has since been deprecated because the communication was mistaken for malware activity.
For SSP startup options, including --sstp-listen, which temporarily specifies the listening address at startup, see Startup options in the SSP Help.
7743 and 9801 are registered in the IANA Port Number Registry, but only port 9801 is actually in use.
Microsoft defined a VPN protocol with the same abbreviation, Secure Socket Tunneling Protocol, but it has no technical relation to SSTP.
By default, the connection is closed at the end of each communication. For frequent communication, the connection can be reused with keep-alive, as with HTTP [SSP 2.9.03].

Direct SSTP

Direct SSTP is a communication specification that uses an IPC mechanism strongly dependent on the operating system. Its protocol specification is the same as (Socket) SSTP, but it is intended to provide lightweight communication by directly specifying a ghost, without using the comparatively resource-intensive TCP/IP.
At present, the specification has been established only for Windows, as follows.

Send WM_COPYDATA using a SendMessage-family function (Post is not allowed)
SendMessage's hWnd = HWND of the destination ghost obtained from FMO
wParam = HWND of “your own” reply destination. The response is received on the HWND (window) specified for WM_COPYDATA.
lParam = pointer to COPYDATASTRUCT
copydatastruct.lpData = string conforming to the SSTP protocol
copydatastruct.cbData = length of the string
copydatastruct.dwData = 9801
Notes:
For safety, the sender should provide a null-terminated string in lpData, and it is preferable for cbData to include the null terminator.
For safety, the receiver must not assume a null terminator and must always process the data based on cbData.
The receiver should treat the HWND specified as the destination as equivalent to the ghost specified in the SSTP protocol, and prioritize that ghost as much as possible.
Both the receiver and sender are assumed to be GUI applications with at least one window; this cannot be used with console applications.

SAORI/1.0 requests can also be sent in the same way to call a baseware built-in module. See SAORI over DirectSSTP.[SSP 2.9.13]

SSTP over HTTP

SSTP over HTTP, implemented in SSP 2.6.32, is a very simple mechanism: an SSTP request is placed directly in the HTTP request message body, and the SSTP response is returned directly in the HTTP response body.
It is intended to make SSTP communication easier when building applications with JavaScript, such as Electron.
Send an HTTP/1.1 POST request with Content-Type: text/plain to localhost:9801 (or a separately specified SSTP port), at /api/sstp/v1.
The response is returned as-is with HTTP/1.1 200 OK and Content-Type: text/plain.
Note that HTTP returns 200 OK even if SSTP encounters an error.
The Content-Length header is required; if it is missing, an error occurs.
HTTP keep-alive is supported. In HTTP/1.1, the connection is maintained by default and closed with Connection: close (for HTTP/1.0, it is maintained only when Connection: keep-alive is specified explicitly). Connections are not maintained for requests with Transfer-Encoding (such as chunked). In this case, connection persistence is determined only by the HTTP settings, and the SSTP Connection header in the message body is ignored [SSP 2.9.03].

Try it

Existing js libraries can be used to communicate via SSTP over HTTP in js.

Note: If the Origin header does not point to localhost, the request is forcibly treated as an SSTP request from a remote address. This imposes strong restrictions on Sakura Script tags and executable SSTP methods, and the SecurityLevel header is also ignored.
These restrictions are relaxed only when the HTTP Origin is localhost and the SSTP SecurityLevel is local.

keep-alive

Starting with SSP 2.9.03, (Socket) SSTP supports sending multiple requests consecutively over a single TCP connection using keep-alive, just like HTTP [SSP 2.9.03].
This avoids the overhead of establishing a connection, making it suitable for clients that send SSTP repeatedly at short intervals.

  • The connection is kept alive only when the request includes a Connection: keep-alive header (the same explicit opt-in as HTTP/1.0). If it is not included, the connection is closed after the response as before, and the response content is unchanged.
  • This applies only to SSTP/1.x. For other versions, the Connection header is ignored and the connection is always closed.
  • Direct SSTP is not covered because it has no concept of a connection. SSTP over HTTP follows the HTTP keep-alive rules (see SSTP over HTTP).
  • If the request includes a Connection header, the response always includes a Connection header as well.
    If Connection: keep-alive and Keep-Alive: timeout=seconds are returned, the connection is being kept alive.
    If Connection: close is returned, the connection is closed after the response (for example, when the maximum number of simultaneous connections has been reached).
  • Responses that keep the connection alive always include Charset and Content-Length headers if there is additional data, and no blank line follows the additional data. If there is no additional data, the response ends with the blank line immediately after the headers.
    Also, the zero terminator (0x00) that was appended to the end of responses when the connection was closed as before is not sent. Determine the end of the response using only the blank line and Content-Length.
  • Send the next request only after the previous response has been fully received (pipelining is not supported). If you send the next request before receiving the response, the connection may be closed after that response.
  • Do not append extra bytes, such as a zero terminator, to the end of a request. They will be treated as part of the next request.
  • If no next request arrives within the number of seconds specified by the Keep-Alive timeout after the response (5 seconds in SSP 2.9.03), SSP closes the connection. The client should be prepared to reconnect and resend the request if the connection is closed at any time.

request sample

EXECUTE SSTP/1.4
Charset: UTF-8
Sender: SSTPクライアント
Command: GetVersion
Connection: keep-alive

response sample (connection kept alive, with data)

SSTP/1.4 200 OK
Charset: UTF-8
Connection: keep-alive
Keep-Alive: timeout=5
Content-Length: 24

追加データはここ

response sample (connection closed, no data)

SSTP/1.4 204 No Content
Charset: UTF-8
Connection: close

request/response

Like SHIORI and other protocols, this is a custom protocol modeled on HTTP.
The request must specify a Charset. If omitted, an error occurs or the request is interpreted using the OS default character encoding.

  • The line ending is CR+LF.
  • A request ends with a blank line ((CR+LF)x2, including the end of the preceding line).
  • A response may contain additional data at the end, as in the case of EXECUTE. After the headers, a blank line is followed by the additional data and another blank line. If there is no additional data, the response may end with just the blank line immediately after the headers.
  • For compatibility, a response with additional data may contain no headers at all, including Charset, and return only the additional data. In that case, the encoding may be assumed to be the same as the request's.
  • The SSTP versions of the request and response may differ. Do not interpret them based on the version number.

request

request example

SEND SSTP/1.0
Charset: UTF-8
Sender: SSTPクライアント
Script: \h\s0テストー。\u\s[10]テストやな。
Option: notranslate

Headers common to all request methods

For method-specific headers, see the descriptions of individual methods below.

Charset
The character encoding of the request. It should preferably appear on the first line.
UTF-8 is recommended unless there is a reason to use another encoding.
Sender
A string identifying the sender, such as "SSTP sending tool". For the COMMUNICATE method, this is the sending ghost's \0 name.
SecurityLevel
Specifies the security level when processing with SHIORI or Sakura Script. Either local or external.
Only valid for DirectSSTP or requests that clearly originate locally, such as from 127.0.0.1.
SSTP over HTTP is always treated as external, except when sent from HTML or similar content served from localhost.
SecurityOrigin [SSP 2.6.59]
A URL-like string identifying the source server, in one of the following formats. It follows the same concept as the HTTP Origin header.
SecurityOrigin: null
SecurityOrigin: <scheme>://<hostname>
SecurityOrigin: <scheme>://<hostname>:<port>
scheme is usually one of http, https, or sstp. hostname is the source server name or IP. port is a port that can receive replies.
If not specified, it is treated as null.
For SSTP over HTTP, the HTTP Origin header's value is always used, and SecurityOrigin in the SSTP request is ignored.
Option
Specifies options for how Sakura Script executed via SSTP is handled.
Multiple options can be specified, separated by commas. The strings are as follows.
nodescript : Disables SSTP display in the balloon (remote SSTP is disabled)
notranslate : Does not perform translation processing via OnTranslate or MAKOTO
nobreak : Waits for the currently executing script to finish without interrupting it
strict : Records Sakura Script interpretation failures in the error log. These include references to nonexistent surfaces (\s), animations (\i), or balloons (\b); unknown tags, \![コマンド], or \&[実体参照]; missing required [] or numbers; and invalid values for \p, \b, \n, \c, or \q. Applies to SEND scripts and scripts returned by a ghost for NOTIFY/GIVE [SSP 2.8.94]
ID
What is known as "Owned SSTP". If an ID sent by SHIORI uniqueid or the FMO identification ID (SSP only) is specified, this SSTP is treated with the same priority as processing internal to the ghost, bypassing security checks, locks, and so on.
SecurityLevel is set to local, and playback can forcibly interrupt even when interruptions are prohibited, such as by \t.
X-SSTP-PassThru-(arbitrary string)
A header passed directly to SHIORI when communicating with a ghost, such as via NOTIFY.
Only minimal processing, such as character encoding conversion, is performed; the (arbitrary string) portion and the content are relayed unchanged.
HWnd
DirectSSTP only. Specifies the window handle to which the response should be sent.
The window handle (equivalent to a pointer) is treated as an unsigned decimal integer and converted to a string.
If omitted, WM_COMMUNICATE's wParam is used.
ReceiverGhostHWnd [SSP 2.5.57]
(Socket)SSTP only. Specifies the window handle of the \0 of the ghost to which the request should be sent.
Specifying this fixes the ghost that handles the request, allowing the same processing as DirectSSTP even over a socket.
If it is not found, processing immediately ends with a 404 Not Found error.
ReceiverGhostName [SSP 2.5.57]
(Socket)SSTP only. Specifies the \0 name of the ghost to which the request should be sent.
Specifying this fixes the ghost that handles the request, allowing the same processing as DirectSSTP even over a socket. This is the name-based version of HWnd.
[SSP 2.9.35] A UUID may be specified instead of a name to select the ghost with that UUID (equivalent to the dedicated ReceiverGhostUUID).
If it is not found, processing immediately ends with a 404 Not Found error.
ReceiverGhostUUID [SSP 2.9.35]
(Socket)SSTP only. Specifies the UUID of the running ghost to which the request should be sent.
Specifying this fixes the ghost that handles the request, allowing the same processing as DirectSSTP even over a socket. This is the UUID-based version of HWnd and avoids confusing ghosts with the same name.
If multiple ghosts with the same UUID are running, the displayed ghost is selected, or otherwise the first in the list of running ghosts.
If no running ghost has a matching UUID, processing immediately ends with a 404 Not Found error (the same applies to values that are not in UUID format).
If more than one of ReceiverGhostHWnd, ReceiverGhostUUID, and ReceiverGhostName is specified, they are evaluated in that order, and the first ghost found is used.

response

response example (without data)

SSTP/1.4 200 OK
Charset: UTF-8
Script: \h\s0テストー。\u\s[10]テストやな。

response example (with data)

SSTP/1.4 200 OK
Charset: UTF-8
Script: \h\s0テストー。\u\s[10]テストやな。

追加データはここ

Headers common to all response methods

Charset
The character encoding of the request. It should preferably appear on the first line.
UTF-8 is recommended unless there is a reason to use another encoding.
This may be deliberately omitted to resolve compatibility issues. In that case, assume the same character encoding as the request.
X-SSTP-PassThru-(arbitrary string)
A header returned directly from SHIORI when communicating with a ghost, such as via NOTIFY.
Only minimal processing, such as character encoding conversion, is performed; the (arbitrary string) portion and the content are relayed unchanged.

response status codes

As with HTTP, 200-series codes indicate successful acceptance; all others indicate errors.

200 OK
Completed successfully (with a return value)
204 No Content
Completed successfully (without a return value)
210 Break
Executed, but interrupted during script execution
Note: This is limited to very specific situations, such as SEND/1.x with Entry; normally, 200 or 204 is returned immediately.
400 Bad Request
The request has a problem that cannot be handled
404 Not Found ※SSP only
In an SSTP request specifying a ghost, the specified ghost is not installed or running
408 Request Timeout
Timeout: unable to communicate with the ghost/SHIORI, for example (rarely occurs under normal conditions)
409 Conflict
Interruptions are prohibited by a \t tag or similar, or another request is being processed
413 Payload Too Large ※SSP only
The SSTP request was too long and processing was refused
420 Refuse
Reception was refused due to the ghost's settings
500 Internal Server Error ※SSP only
Processing could not be completed due to a problem detected internally by the implementation
501 Not Implemented
Processing could not be completed because the request included an unimplemented command or similar
503 Service Unavailable
The implementation cannot accept SSTP due to internal circumstances
505 Version Not Supported ※SSP only
The SSTP version is invalid (below 1.0, 3.0 or higher, etc.)
512 Invisible
The ghost is not displayed, for example because it is minimized, and cannot process anything

Method: NOTIFY

This method notifies a ghost of an event.
SEND and NOTIFY are handled identically and have no functional differences. For details about shared headers and routing rules for IfGhost, see Method: SEND.
The Event header corresponds to the SHIORI/3.0 ID, and Reference* is passed through unchanged.

Event notification only sample (NOTIFY/1.0)

NOTIFY SSTP/1.0
Charset: UTF-8
Sender: Media Player
Event: OnMusicPlay
Reference0: 自由の翼
Reference1: Linked Horizon

If the ghost does not respond to the specified event ID, you can specify a “fallback” script to be played instead.
When an IfGhost header is specified, the Script header immediately after it is treated as a script exclusively for the specified ghost.

Sample with fallback response (NOTIFY/1.1)

NOTIFY SSTP/1.1
Charset: UTF-8
Sender: Media Player
Event: OnMusicPlay
Reference0: 紅蓮の弓矢
Reference1: Linked Horizon
IfGhost: Emily,Teddy
Script: \0\s[6]その日、エミリは思い出した…\n\s[7]まだ今日は芋食べてない!\1\s[11]わざわざ今思い出したの?
IfGhost: ラーシェ,ティセ
Script: \0\s[3]巨人っていっても、身長は列車数両分しかないよね。\1\s[14]それが縦に立ち上がるとさすがに大きいと思うけどね。

Request-specific headers

For details about the shared headers Event, Reference*, Script, IfGhost, Ghost, and others, see Method: SEND.

Option
Specifies options for how Sakura Script executed by SSTP or the specified event is handled.
Multiple options can be specified as a comma-separated list. The NOTIFY-specific option is as follows.
notify : Force the event to be sent as NOTIFY. Also, the fallback script is forced to be handled in the same way as when returned in the ValueNotify header. [SSP 2.6.76]

Response-specific headers

Script
The script played as a result of the event notification. Currently supported only by SSP.

Method: SEND

SEND is a method for sending Sakura Script or SHIORI events from an external application to a ghost for playback.
SEND and NOTIFY are handled identically. There is no functional difference between them. The following specifications also apply to NOTIFY.
Both specifying Sakura Script directly in the Script header and sending an event in the Event header to obtain a script from the SHIORI response are supported.
Event and Script can be used together. If the SHIORI response to the Event does not return a script, the script in the Script header is used as a fallback.
If no target ghost is specified, the currently running ghost is targeted.

Basic script playback example

SEND SSTP/1.4
Charset: UTF-8
Sender: SampleApp
Script: \h\s[0]こんにちは。\w5\u\s[10]ご機嫌いかが?\e

Event sending example

SEND SSTP/1.4
Charset: UTF-8
Sender: SampleApp
Event: OnExternalEvent
Reference0: param1
Reference1: param2

Event with fallback script example

SEND SSTP/1.4
Charset: UTF-8
Sender: SampleApp
Event: OnCustomEvent
Reference0: data
Script: \h\s[0]イベント未対応時のスクリプト\e

By specifying multiple IfGhost headers and pairing them with corresponding Script headers, different scripts can be specified for each ghost.

IfGhost routing example

SEND SSTP/1.4
Charset: UTF-8
Sender: SampleApp
Script: \h\s[0]こんにちは。\e
IfGhost: まゆら
Script: \h\s[0]まゆらさん、こんにちは。\e
IfGhost: 花ちゃん,妹
Script: \h\s[0]花ちゃんと妹さん、こんにちは。\e

Interruption suppression example

SEND SSTP/1.4
Charset: UTF-8
Sender: SampleApp
Script: \h\s[0]割り込まないで追加。\e
Option: nobreak

Request-specific headers

Sender
A common header, but Sender: First can be used as a special value for SEND/NOTIFY. When specified, it targets the ghost (sakura) from the first startup.
If neither Sender nor User-Agent is specified, a 400 Bad Request is returned.
Script
The Sakura Script to play.
When used with the Event header, it is used as a fallback if the SHIORI response to the Event does not return a script.
Entry
Entry data. It is passed to SHIORI.
Event
The SHIORI event name. In SHIORI/3.0, it is treated as the ID header.
Reference*
The event's Reference header. It is passed to SHIORI as is, after minimal processing such as character encoding conversion.
IfGhost
When ghost names are specified in the format \0 side name,\1 side name, the immediately following Script header is treated as exclusive to that ghost.
A Script header that does not immediately follow an IfGhost header is used as the default script when no IfGhost matches.
[SSP 2.9.35] A ghost's UUID can also be specified instead of names (in UUID form, without a comma). This allows ghosts with the same names to be distinguished.
If omitted, the same Script header is played for every ghost.
For detailed routing rules, see Script routing with IfGhost below.
Ghost
Specifies the target ghost by its ghost name (name in descript.txt).
Option
Specifies options for how Sakura Script executed via SSTP is handled.
Multiple options can be specified, separated by commas. In addition to common options (nodescript, notranslate, etc.), the following option flags can be used with SEND/NOTIFY.
nobreak : Queues the script without interrupting the script currently playing.
notify : Sends the SHIORI event in notify mode (no response required). The script is also forcibly handled in the same way as when returned in a ValueNotify header. [SSP 2.6.76]

Response-specific headers

Script
The script that was actually played. Line breaks are removed.
SHIORI custom headers
Headers included in the SHIORI response are passed through.

Script routing with IfGhost

By specifying multiple IfGhost headers and pairing them with corresponding Script headers, different scripts can be specified for each ghost.
IfGhost and Script headers are paired in order of appearance. A Script specified before the first IfGhost becomes the default script.

Name matching
If IfGhost is in the format "\0 side name,\1 side name", both names must match.
If IfGhost contains only the "\0 side name", the script is selected based on a match of the \0 side name alone.
[SSP 2.9.35] If IfGhost is in UUID form (22 base64 characters and ==), the script is selected by matching the ghost's UUID rather than its names. If multiple ghosts with the same UUID are running, the displayed ghost takes priority.
If none match, the default script is used. However, if the ghost is configured to reject unspecified SSTP, the default script is not used either.
Default ghost handling
The following names are treated as the default ghost (sakura), and their scripts also function as default scripts.
"さくら", "エミリ", "えみりぃ"

Method: COMMUNICATE

The COMMUNICATE method lets you provide a ghost with an arbitrary string from outside and make it respond.
This is basically the same as a response to text entered in the ghost's internal communicate box, but because this is SSTP, the ghost may not accept it.

Simple COMMUNICATE (COMMUNICATE/1.1)

COMMUNICATE SSTP/1.1
Charset: UTF-8
Sender: User
Sentence: おはよう。

Communicate messages can be sent and received repeatedly between SSTP servers (≈ ghosts).
When sending through Reference0 in a SHIORI/3.0 response, the SSTP message is sent after Sakura Script playback has finished.
This makes it possible to set up behavior that makes ghosts running at the same time appear to be conversing.

Inter-ghost communicate (COMMUNICATE/1.2)

COMMUNICATE SSTP/1.2
Charset: UTF-8
Sender: Emily
HWnd: 28236
Sentence: \0\s[5]ちゃっらーん!エミリでーす!\nボクのお腹にはまだ若干の余裕が…?\1\s[11]そんなこと言ってたらまた太るよ?
Surface: 5,11
Reference0: 芋ちょうだい
Reference1: たくさんちょうだい
Reference2: 今すぐちょうだい

Request-specific headers

Reference*
Additional information for the communicate message. In SHIORI/3.0, it is stored in Reference2 and later. SSTP Reference0 = SHIORI Reference2.
Surface
The surface numbers for \0 and \1 at the time the sending ghost sends the communicate message (≈ when script execution ends).
Passed as the Surface header in the OnCommunicate event.
Option
[Legacy specification] If substitute is specified, \1 speaks the contents of Sentence. ※Not implemented in SSP

Method: EXECUTE

The EXECUTE method retrieves various information about a ghost and executes various commands without using Sakura Script.
The ghost does not speak when this method is executed, but its internal state may change.

EXECUTE sample

EXECUTE SSTP/1.1
Charset: UTF-8
Sender: SSTPクライアント
Command: GetName

Request-specific headers

Command or Command[param1,param2...]
The command to execute. The actions performed and information returned are described below.
The square brackets and their contents specify parameters to pass to the command.
Reference* [SSP]
Parameters can also be specified in headers starting with Reference0 instead of using square brackets.

See below for the strings that can be specified in the Command header and the results returned as additional data in the response.

Commands available in the Command header and the additional data returned

GetName
The running ghost's (\0 name),(\1 name), separated by a comma.
GetNames [SSP]
A list of the \0 names of currently installed ghosts, separated by newlines and terminated by an empty line.
GetFMO [SSP 2.5.57] [remote restrictions apply]
Retrieves information equivalent to the contents of FMO.
Unlike the actual FMO, which is shared by concurrently running applications, this is limited to information managed internally by the application communicating via SSTP.
It is mainly used by console applications that have no window and cannot send Direct SSTP, to use the ReceiverGhostHWnd header with Socket SSTP alone to achieve functionality equivalent to Direct SSTP.
Entries are separated by newlines and terminated by an empty line.
For remote requests, path information is omitted, and the header and hwnd are replaced with dummy values.
GetGhostName [SSP]
The name of the running ghost itself (name in descript.txt).
GetShellName [SSP]
The name of the shell currently used by the running ghost.
GetBalloonName [SSP]
The name of the balloon currently used by the running ghost.
GetVersion
The version of the baseware (the running software).
GetGhostNameList [SSP 2.6.53]
A newline-separated list of the names (name in descript.txt) of all ghosts recognized by SSP.
GetShellNameList [SSP 2.6.53]
A newline-separated list of the names (name in descript.txt) of all shells recognized by the running ghost.
GetBalloonNameList [SSP 2.6.53]
A newline-separated list of the names (name in descript.txt) of all balloons recognized by SSP.
GetHeadlineNameList [SSP 2.6.53]
A newline-separated list of the names (name in descript.txt) of all headlines recognized by SSP.
GetPluginNameList [SSP 2.6.53]
A newline-separated list of the names (name in descript.txt) of all plugins recognized by SSP.
GetGhostUUIDList [SSP 2.9.35]
A newline-separated list of the UUIDs of all ghosts recognized by SSP, in the same order as GetGhostNameList.
GetBalloonUUIDList [SSP 2.9.35]: The UUIDs of all balloons, in the same order as GetBalloonNameList.
GetShellUUIDList [SSP 2.9.35]: The UUIDs of all shells recognized by the running ghost, in the same order as GetShellNameList.
UUIDs are calculated from the values in descript.txt using the metainfo-standard procedure (the same as uuid in the property system).
GetGhostMetaInfoList [SSP 2.9.35]
A newline-separated list of the URLs of the metainfo folders of all ghosts recognized by SSP, in the same order as GetGhostNameList.
GetBalloonMetaInfoList [SSP 2.9.35]: The URLs of the metainfo folders of all balloons, in the same order as GetBalloonNameList.
GetShellMetaInfoList [SSP 2.9.35]: The URLs of the metainfo folders of all shells recognized by the running ghost, in the same order as GetShellNameList.
These are the metainfo values in descript.txt. If absent, the URL is derived from githubrepo (the default branch is assumed to be master). If neither is present, the entry is an empty line.
GetShortVersion [SSP 2.6.53]
The version of the baseware (the running software), containing only the period-separated version number.
A simple comparison with ssp.full.version in version.json, for example, can determine whether it is the latest version.
GetStatus [SSP 2.8.94]
The current execution state of the running ghost. It has the same contents as the Status header of a SHIORI/3.0 request and currentghost.status in the property system.
If multiple states apply, they are separated by commas. See SHIORI Status header for the meaning of each value.
If no state applies, there is no additional data (status code 200).
Quiet [not available remotely]
Remains silent until Restore is executed or 16 seconds have passed. No additional data (a 200-series status code indicates success).
Restore
Cancels Quiet. No additional data (a 200-series status code indicates success).
CompressArchive [SSP 2.7.23] [not available remotely]
Compresses the files in the specified folder into a ZIP file. If the destination extension is .7z, the format is 7z; otherwise, it is ZIP (even if .lzh or .cab is specified, the contents are ZIP). Hidden files and folders are excluded.
Parameter 0: Archive file name (specify a full path; relative paths are not allowed).
Parameter 1: Full path of the folder to compress.
Parameter 2 onward: Options (optional).
The options are as follows.
--event=event identifier: If an event identifier is specified, compression continues after the response, and an event occurs upon completion. If the identifier starts with On, an event with that identifier occurs; otherwise, OnCompressArchiveComplete or OnCompressArchiveFailure occurs. If omitted, no response is returned until processing completes.
--password=password: Enables AES-encrypted ZIP using the specified password.
See OnCompressArchiveComplete and OnCompressArchiveFailure for specifications of events after the operation.
[SSP 2.9.25] From SAORI over DirectSSTP, this can also be called using CompressArchive in internal_file (relative paths and / separators can also be used).
[SSP 2.9.33] If parameter 1 is not a folder (for example, a file path), the operation fails with 400 without compressing (if --event= is specified, the failure event (OnCompressArchiveFailure or the identifier with Failure appended) occurs with invalid parameter). Previously, passing a file path caused compression to fail with file not found.
For security reasons, the compression destination is restricted to locations under folders managed by SSP (locations specified in the "Folders" settings, such as the ghost and balloon folders).
As this restriction may be strengthened as needed, it is safer to limit the destination to a folder under the folder containing the ghost's own data.
No additional data (a 200-series status code indicates success).
ExtractArchive [SSP 2.7.23] [not available remotely]
Extracts the specified archive. In addition to ZIP, formats such as 7z and tar can also be extracted (see ExtractArchive in internal_file for supported formats).
Parameter 0: Archive file name (specify a full path; relative paths are not allowed).
Parameter 1: Full path of the destination folder.
Parameter 2 onward: Options (optional).
The options are as follows.
--event=event identifier: If an event identifier is specified, extraction continues after the response, and an event occurs upon completion. If the identifier starts with On, an event with that identifier occurs; otherwise, OnExtractArchiveComplete or OnExtractArchiveFailure occurs. If omitted, no response is returned until processing completes.
--password=password: Extracts using the specified password. [SSP 2.9.26] No password prompt is displayed. If a password is required but not specified, or is incorrect, the operation fails without a dialog (the response is 500; if an event was specified, the event is the identifier plus Failure, or OnExtractArchiveFailure). In [SSP 2.9.25] and earlier, this option was ignored and a dialog was displayed.
[SSP 2.9.26] Even if an absolute path containing .. is specified as the destination, it is rejected if the resolved path is outside folders managed by SSP (previously, extraction outside managed folders was possible).
See OnExtractArchiveComplete and OnExtractArchiveFailure for specifications of events after the operation.
[SSP 2.9.25] From SAORI over DirectSSTP, this can also be called using ExtractArchive in internal_file (relative paths and / separators can also be used).
For security reasons, the extraction destination is restricted to locations under folders managed by SSP (locations specified in the "Folders" settings, such as the ghost and balloon folders).
As this restriction may be strengthened as needed, it is safer to limit the destination to a folder under the folder containing the ghost's own data.
No additional data (a 200-series status code indicates success).
DumpSurface [SSP 2.5.98] [not available remotely]
Outputs composited surface images to the specified directory. The parameters are the same as for \![execute,dumpsurface].
However, an event ID cannot be specified; specify the directory, scope ID, surface list, prefix, zero-position cropping, and animation ID [SSP 2.9.05], in that order.
[SSP 2.9.08] As with the Sakura Script version, parameters can also be specified in any order using the forms --dir= / --scope= / --surface= / --prefix= / --fromzero= / --animation=, and mixed with positional parameters (parameters not starting with -- are assigned in the order listed above, in the order they appear). All parameters except the directory can be omitted; the scope ID defaults to 0. --event= is ignored.
Because commas cannot be used in parameters in the DumpSurface[...] form, specify surface lists containing commas in Reference0 and subsequent headers.
Note that no response is returned until processing completes.
No additional data (a 200-series status code indicates success).
MoveAsync [SSP] [not available remotely]
Performs the same operation as \![moveasync] without using Sakura Script. Parameters are specified in the same way as in the Sakura Script version.
A move without async cannot be executed because it cannot return a response before the SSTP timeout and would cause a deadlock.
No additional data (a 200-series status code indicates success).
SetTrayIcon [SSP] [not available remotely]
Performs the same operation as \![set,tasktrayicon] without using Sakura Script. Parameters are specified in the same way as in the Sakura Script version.
No additional data (a 200-series status code indicates success).
SetTrayBalloon [SSP] [not available remotely]
Performs the same operation as \![set,trayballoon] without using Sakura Script. Parameters are specified in the same way as in the Sakura Script version.
No additional data (a 200-series status code indicates success).
SetProperty [SSP] [not available remotely]
Writes a value to the property system.
Parameter 0: Property name.
Parameter 1: Value to set.
No additional data (a 200-series status code indicates success).
GetProperty [SSP]
Reads a value from the property system.
Parameter 0: Property name.
The additional data is the retrieved property value.
SetCookie
Writes to a general-purpose data storage area maintained separately for each client name specified by Sender.
It is intended for use similar to browser cookies.
Parameter 0: Cookie name.
Parameter 1: Value to set.
No additional data (a 200-series status code indicates success).
GetCookie
Reads from a general-purpose data storage area maintained separately for each client name specified by Sender.
Parameter 0: Cookie name.
The additional data is the retrieved cookie value.

Method: GIVE

[Legacy specification] This method provides a ghost with various types of data for processing or to elicit a response.
This is a very old specification, and there is no reason to use it now. Use NOTIFY or COMMUNICATE instead.

Request sample

GIVE SSTP/1.1
Charset: UTF-8
Sender: SSTPクライアント
Document: まず水や。それから粉やな。
GIVE SSTP/1.1
Charset: UTF-8
Sender: SSTPクライアント
Song: 佐世保の時雨

Request-specific headers

Document
A document (a general-purpose string)
In SHIORI/3.0, this is treated the same as user communicate input, and an OnCommunicate event is raised.
Song
The name of a song.
In SHIORI/3.0, an OnMusicPlay event is raised, and Reference0 is set to the string specified in the Song header.