// without an argument, wssh will use the form data to connect
wssh.connect();
// set a new encoding for client to use
wssh.set_encoding(encoding);
// reset encoding to use the default one
wssh.reset_encoding();
// send a command to the server
wssh.send('ls -l');
```
```
### Tests
### 3. jfadmin config (option)
Use unittest to run all tests
modify jfadmin.conf, add section
```
python -m unittest discover tests
```
Use pytest to run all tests
```
```
python -m pytest tests
[webssh]
proxy = http://webssh_ip:8888/
```
```
### An example of config for running this app behind an Nginx server
```nginx
location/{
proxy_passhttp://127.0.0.1:8888;
proxy_http_version1.1;
proxy_read_timeout300;
proxy_set_headerUpgrade$http_upgrade;
proxy_set_headerConnection"upgrade";
proxy_set_headerHost$http_host;
proxy_set_headerX-Real-IP$remote_addr;
proxy_set_headerX-Real-PORT$remote_port;
}
```
## Tips
* Try to use Nginx as a front web server (see config example above) and enable SSL, this will prevent your ssh credentials from being uncovered. Also afterwards the communication between your browser and the web server will be encrypted as they use secured websockets.
* Try to use reject policy as the missing host key policy along with your verified known_hosts, this will prevent man-in-the-middle attacks. The idea is that it checks the system host keys file("~/.ssh/known_hosts") and the application host keys file("./known_hosts") in order, if the ssh server's hostname is not found or the key is not matched, the connection will be aborted.