-
Notifications
You must be signed in to change notification settings - Fork 482
pass web headers/environment to shell program #62
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
Comments
I second this. Something as simple as the ability to pass shell arguments after starting the process would be great. Right now it looks like shellArgs is not editable on the fly. |
That's funny, I actually just committed a small change which allows |
That's awesome! How would you recommend we pass data from the web environment to the callbacks? (Textbox values etc.) |
Example: var app = tty.createServer({
shell: function(session) {
return session.req.headers['x-process'] || 'bash';
},
shellArgs: function(session) {
return session.req.headers['x-args'].split(' ');
},
port: 8000
}); |
I will probably make an |
Ok thanks that helped a bunch! |
how do you send the x- headers from the client? |
@adamjimenez, depends on the client. This isn't limited to headers. You could parse a querystring for args if you wanted to. |
I guess the best place would be when I do:
But this only accepts rows and cols and I want to pass different shellargs each time. So that users can open connections to different hosts. |
I could but I want to re-use an existing socket in order to handle simultaneous connections. |
Feature idea: I would like to be able to pass the information about the web environment to the shell program somehow (either as arguments or as environment variables)
e.g. variables such as REMOTE_ADDR, HTTP_X_FORWARDED_FOR could be exposed to the underlying shell program.
Ultimately, I want my reverse proxy server to authenticate the user and pass a SAML assertion (or equivalent) to tty.js, so the shell program can use upstream authentication.
The text was updated successfully, but these errors were encountered: