http-go

command
v0.12.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2026 License: MIT Imports: 5 Imported by: 0

README

HTTP Go Plugin

This example exposes the full Scriptling plugin protocol over HTTP instead of stdio. The server mounts plugin.NewServer(...).ServeHTTP at /json-rpc, and a Scriptling script loads it with scriptling.plugin.load(..., scriptling=True).

HTTP plugin transport is request/response only: it supports plugin handshakes, function calls, object lifecycle, and batches, but the server cannot initiate callbacks back to the client. Host callbacks and plugin.Logger(ctx) require the bidirectional stdio transport, so keep using executable plugins for those.

Run

From the repository root:

go run ./examples/plugins/http-go

In another terminal:

scriptling examples/plugins/http-go/client.py

Expected output:

1.0.0
Hello, Ada
15
unloaded

HTTPS with a self-signed certificate

Clients can opt into skipping TLS verification for trusted local/internal endpoints:

name = scriptling.plugin.load(
    "hello_http",
    "https://127.0.0.1:8443/json-rpc",
    scriptling=True,
    insecure_skip_tls=True,
    headers={"Authorization": "Bearer token"},
)

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL