https://github.com/hacknlove/autarchy-server
https://github.com/hacknlove/autarchy-server
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/hacknlove/autarchy-server
- Owner: hacknlove
- Created: 2021-08-13T06:21:03.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-08-20T14:11:28.000Z (almost 5 years ago)
- Last Synced: 2025-01-08T20:50:58.988Z (over 1 year ago)
- Language: JavaScript
- Size: 108 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# autarchy-server
## Server behaviour
It listen at the port `CHANNEL` and at the port `PORT`
First connection to the port `CHANNEL` is consider main connection with the client
When any connection `P` arrives at `PORT` the server sends an `iv` to the client and pushes `P` in a fifo
The client connects again (`C`) the server pulls the first item (`P`) of the FIFO and creates a encrypted pipe `P<-->C`
The server encrypts the data before sending it to the client with some `PASSWORD` and a `iv` equals to a sha256 hash of `SECRET` + `iv`
The server decrypts the data before sending it to the origen of the request with some `PASSWORD` and a `iv` equals to a sha256 hash of `iv` + `SECRET`
## Client behaviour
The client is responsible for reading the request, sending it to the specific service and returning the response through the same socket.
## Server configuration
```javascript
// ./config.js
module.exports = {
clients: {
'00000000': {
domains: [
'foo.autarchy.dev',
'bar.autarchy.dev',
],
secret: 'SECRET'
},
...
}
}
```
* clientId is any 8 bytes length string
* domains is an array with the domains that can be redirected to the user
* secret is used for hashing and encryption