Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: HTTP API #120

Closed
MarketingPip opened this issue Dec 9, 2022 · 5 comments
Closed

Feature Request: HTTP API #120

MarketingPip opened this issue Dec 9, 2022 · 5 comments

Comments

@MarketingPip
Copy link

I don't know if these are both two much to ask - but it would be great to get an API that allows you to call a command via API / HTTP query. (which stores session ID - to keep it started and kills it after X amount of time if no command is sent)

And it would be sweet if you were nice enough to host the API.

@nirui
Copy link
Owner

nirui commented Dec 10, 2022

Sorry, I think such feature belongs more to an asset management software, while Sshwifty just trying to be a simple client for SSH and Telnet that you can run in your browser.

The goal is not really the same between the two types. Sorry again.

@MarketingPip
Copy link
Author

Sorry, I think such feature belongs more to an asset management software, while Sshwifty just trying to be a simple client for SSH and Telnet that you can run in your browser.

The goal is not really the same between the two types. Sorry again.

Well that is my goal - I am hoping to hook it up to an instance of Termino.js. See repo - here

To be used as client side anywhere - then we can connect SSH client side from another website instead of just directly on the main site.

@nirui
Copy link
Owner

nirui commented Dec 11, 2022

If I read it correctly, you want to use Sshwifty as a pure backend and implement a new front-end with your project Termino.js?

If that's the case, sending SSH commands (and reading results) is just normal SSH features and can be implemented completely at the front-end without the need to modify Sshwifty at all. You can basically ask Sshwifty backend to do anything you want (open SSH connection, send command, read response and close the connection etc) through the WebSocket connection if you implemented the comm protocol used by Sshwifty.

But at that point, you might as well implement your own backend server. The whole thing is not really hard.

BTW: Probably not what you wanted, but Sshwifty does support a feature called launch link which automatically connects you with a terminal after Sshwifty webpage is loaded (for example: https://sshwifty-demo.nirui.org/#+Telnet:horizons.jpl.nasa.gov:6775%7Cutf-8). It don't do anything more than that though (no session ID management, command or timeout handling etc).

@MarketingPip
Copy link
Author

If I read it correctly, you want to use Sshwifty as a pure backend and implement a new front-end with your project Termino.js?

If that's the case, sending SSH commands (and reading results) is just normal SSH features and can be implemented completely at the front-end without the need to modify Sshwifty at all. You can basically ask Sshwifty backend to do anything you want (open SSH connection, send command, read response and close the connection etc) through the WebSocket connection if you implemented the comm protocol used by Sshwifty.

But at that point, you might as well implement your own backend server. The whole thing is not really hard.

BTW: Probably not what you wanted, but Sshwifty does support a feature called launch link which automatically connects you with a terminal after Sshwifty webpage is loaded (for example: https://sshwifty-demo.nirui.org/#+Telnet:horizons.jpl.nasa.gov:6775%7Cutf-8). It don't do anything more than that though (no session ID management, command or timeout handling etc).

Not what I meant. 😢 - I mean / meant - you can access / connect to your own server via SSH on the demo here right https://sshwifty-demo.nirui.org ..? Why not provide access so Termino.js and other libraries can use the API directly instead of having to setup sshwifty on their OWN server. (meaning I could host / connect to sshwifty via GitHub pages - via static hosted website.)

@nirui
Copy link
Owner

nirui commented Dec 12, 2022

Well, it's just a demo instance, you suppose to host Sshwifty by yourself on your own server (preferably on the same host that also hosts the target SSH server, there are security concerns on why this is recommended). I can't really afford the cost that comes with providing stable service at larger scales.

@nirui nirui closed this as completed Jan 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants