Skip to content

JavaScript library for getting shell access to the server in the browser.

Notifications You must be signed in to change notification settings

Sumit931kr/shell-access

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shell-access

shell-access is an npm library that provides server access through a web browser.

Installation

To install shell-access, use npm:

npm install shell-access@latest

Prerequisites

  • Express server
  • http-proxy-middleware

Make sure to install http-proxy-middleware in your server: by using

npm install http-proxy-middleware

Usage

  1. Initialize the shell-access in your server code:
const initialization = require('shell-access');

// <!-- pass the passcode in function -->
initialization("passcode");
  1. Set up the proxy middleware in your Express server:
const { createProxyMiddleware } = require('http-proxy-middleware');

// Proxy for the shell-access service
app.use('/shell-access', createProxyMiddleware({
  target: 'http://localhost:8765',
  ws: true,
  changeOrigin: true,
}));

Usage

Here’s a basic example of how to integrate shell-access with an Express server:

const express = require('express');
const initialization = require('shell-access');
const { createProxyMiddleware } = require('http-proxy-middleware');

const app = express();

// Initialize shell-access
// <!-- pass the passcode in function -->
initialization("passcode");


// Set up proxy middleware
app.use('/shell-access', createProxyMiddleware({
  target: 'http://localhost:8765',
  ws: true,
  changeOrigin: true,
}));

app.listen(3000, () => {
  console.log('Server is running on port 3000');
});

now go to http://localhost:3000/shell-access to access your shell.

How It Works

  • The initialization() function sets up the necessary configuration for shell access.
  • The createProxyMiddleware function proxies requests from the client to the server, enabling real-time communication.

Contributing

Contributions are welcome! Please feel free to submit a pull request or open an issue to report bugs or request features.

License

This project is licensed under the MIT License

Support

If you encounter any issues, feel free to open an issue on GitHub or contact me directly.

About

JavaScript library for getting shell access to the server in the browser.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published