Skip to content

Commit

Permalink
Update of README.md with apache snippet and removal of app.js (#25)
Browse files Browse the repository at this point in the history
* Added Apache configuration for proxifying wetty.

* Typo fix for Apache configuration.

* Updated procedure for starting wetty (use of bin/index.js instead of app.js)
  • Loading branch information
mirtouf authored and butlerx committed Oct 22, 2017
1 parent 1833185 commit f2fcfd0
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ or
## Run on HTTP

``` bash
node app.js -p 3000
node bin/index.js -p 3000
```

If you run it as root it will launch `/bin/login` (where you can specify
Expand Down Expand Up @@ -58,13 +58,13 @@ openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 30000 -no
And then run:

```
node app.js --sslkey key.pem --sslcert cert.pem -p 3000
node bin/index.js --sslkey key.pem --sslcert cert.pem -p 3000
```

Again, if you run it as root it will launch `/bin/login`, else it will
launch SSH to `localhost` or a specified host as explained above.

## Run wetty behind nginx
## Run wetty behind nginx or apache

Put the following configuration in nginx's conf:

Expand All @@ -81,13 +81,26 @@ Put the following configuration in nginx's conf:
proxy_set_header X-NginX-Proxy true;
}

If you are running `app.js` as `root` and have an Nginx proxy you have to use:
Put the following configuration in apache's conf:

RewriteCond %{REQUEST_URI} ^/wetty/socket.io [NC]
RewriteCond %{QUERY_STRING} transport=websocket [NC]
RewriteRule /wetty/socket.io/(.*) ws://localhost:9123/wetty/socket.io/$1 [P,L]

<LocationMatch ^/wetty/(.*)>
DirectorySlash On
Require all granted
ProxyPassMatch http://127.0.0.1:9123
ProxyPassReverse /wetty/
</LocationMatch>

If you are running `bin/index.js` as `root` and have an Nginx proxy you have to use:

```
http://yourserver.com/wetty
```

Else if you are running `app.js` as a regular user you can use:
Else if you are running `bin/index.js` as a regular user you can use:

```
http://yourserver.com/wetty/ssh/<username>
Expand Down

0 comments on commit f2fcfd0

Please sign in to comment.