Get app data (ssh list, live list, die list) from SSH checking in JSON format.
-
URL
- /check-ssh/ssh (Imported SSH list)
- /check-ssh/live (Live SSH)
- /check-ssh/die (Die SSH)
-
Method:
GET -
Success Response:
- Code: 200
Content:[{"ip": "14.160.52.26", "username": "admin", "password": "admin"}]
- Code: 200
-
Sample Call:
$.ajax({ url: "/check-ssh/ssh", dataType: "json", type : "GET", success : function(ssh_list) { console.log(ssh_list); } });
Get SSH list and port connection status from /connect-ssh in JSON format.
-
URL
- /connect-ssh/ssh (Imported SSH list) (same as above)
- /connect-ssh/port-info (SSH IPs connected with ports)
-
Method:
GET -
Success Response:
- Code: 200
Content:{"8000": "14.160.52.26", "8001": ""}
- Code: 200
-
Sample Call:
$.ajax({ url: "/connect-ssh/port-info", dataType: "json", type : "GET", success : function(port_info) { console.log(port_info); } });
Emit a signal to both server and connected clients. Use for action triggering/data importing.
-
URL
/emit
-
Method:
POST -
JSON body
Required:
event=event_nameOptional:
namespace=/namespace/path(defaults to default namespace)data=<data>argument(s) to pass with event (use tuple to pass multiple arguments) -
Success Response:
- Code: 200
Content:1
- Code: 200
-
Error Response:
- Code: 400 BAD REQUEST
Content:0
- Code: 400 BAD REQUEST
-
Sample Call:
$.ajax({ url: "/emit", type : "POST", success : function(r) { console.log(r); } });
Import SSH list, saved to server file.
-
Namespace: /check-ssh or /connect-ssh
-
Event name:
ssh -
Params
ssh: SSH listExample:[{"ip": "14.160.52.26", "username": "admin", "password": "admin"}] -
Usage
If
sshis present, SSH list will be set tossh, otherwise this event will be ommitted.
Start checking SSH, generating live & die SSH lists.
-
Namespace: /check-ssh
-
Event name:
check_ssh -
Params: None
Clear previously generated live/die SSH list.
-
Namespace: /check-ssh
-
Event name:
clear_live/clear_die -
Params: None
Perform port forwarding to specified ports, with auto reconnecting when needed.
-
Namespace: /connect-ssh
-
Event name:
connect_ssh -
Params
port_list: port listExample:[8000, 8005]
Returns if SSH list is used up or not.
-
Namespace: /connect-ssh
-
Event name:
out_of_ssh -
Params: None
-
Returns
1if SSH is used up, or the SSH connection hasn't started.0if everything is fine.
Reset port forwarding to specified port, reconnecting to a new one if possible.
-
Namespace: /connect-ssh
-
Event name:
reset_port -
Params:
port Port to reset
Example: 8000
Stop all port forwarding to all ports.
-
Namespace: /connect-ssh
-
Event name:
disconnect_all_ssh -
Params: None
Written with StackEdit.