[GH-ISSUE #2778] [Feature Request] first API requirements #2223

Closed
opened 2026-05-05 13:25:48 -06:00 by gitea-mirror · 1 comment
Owner

Originally created by @penguine on GitHub (Jan 24, 2022).
Original GitHub issue: https://github.com/fatedier/frp/issues/2778

Describe the feature request

API

The API wrapper gives access to all the frp-Client API methods:
const url = await frpc.connect();
const api = frpc.getApi();

Authtoken
const tunnels = await api.registerAuthtoken(token);

Reset Authtoken
const token = await api.resetAuthtoken();

List tunnels
const tunnels = await api.listTunnels();
Start tunnel
const tunnel = await api.startTunnel(opts);
Get tunnel details
const tunnel = await api.tunnelDetail(tunnelName);
Stop tunnel
await api.stopTunnel(tunnelName);

Set Auto Reload
await api.reload(true);

Reload once
await api.reloadIni(path); // if not set then load the actual file

later for the requests:

List requests
await api.listRequests(options);
Replay request
await api.replayRequest(requestId, tunnelName);
Delete all requests
await api.deleteAllRequests();
Request detail
const request = await api.requestDetail(requestId);

Disconnect Process
await frpc.disconnect(url); // stops one
await frpc.disconnect(); // stops all
await frpc.kill(); // kills frpc processes

Originally created by @penguine on GitHub (Jan 24, 2022). Original GitHub issue: https://github.com/fatedier/frp/issues/2778 ### Describe the feature request ### API The API wrapper gives access to all the frp-Client API methods: const url = await frpc.connect(); const api = frpc.getApi(); **Authtoken** const tunnels = await api.registerAuthtoken(token); **Reset Authtoken** const token = await api.resetAuthtoken(); **List tunnels** const tunnels = await api.listTunnels(); **Start tunnel** const tunnel = await api.startTunnel(opts); **Get tunnel details** const tunnel = await api.tunnelDetail(tunnelName); **Stop tunnel** await api.stopTunnel(tunnelName); **Set Auto Reload** await api.reload(true); **Reload once** await api.reloadIni(path); // if not set then load the actual file later for the requests: **List requests** await api.listRequests(options); **Replay request** await api.replayRequest(requestId, tunnelName); **Delete all requests** await api.deleteAllRequests(); **Request detail** const request = await api.requestDetail(requestId); **Disconnect Process** await frpc.disconnect(url); // stops one await frpc.disconnect(); // stops all await frpc.kill(); // kills frpc processes
gitea-mirror 2026-05-05 13:25:48 -06:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 24, 2022):

Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.

<!-- gh-comment-id:1049363722 --> @github-actions[bot] commented on GitHub (Feb 24, 2022): Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#2223
No description provided.