https://github.com/ivarref/yasp
https://github.com/ivarref/yasp
Last synced: 16 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ivarref/yasp
- Owner: ivarref
- Created: 2023-09-14T10:46:07.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-07T19:42:57.000Z (over 1 year ago)
- Last Synced: 2024-08-08T19:26:43.491Z (over 1 year ago)
- Language: Clojure
- Size: 138 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# yasp
Yasp and its companion yasp-client is proxy that does
TCP over HTTP(S), encoded as JSON.
It can also do mutual TLS termination.
Yasp requires that your Clojure web server can receive a HTTP POST JSON
request and produce a JSON response.
The server component otherwise only has a single dependency: `clojure.tools.logging`.
## Overview
```mermaid
sequenceDiagram
local PC / e.g. nrepl->>yasp-client: TCP
yasp-client->>yasp-client-tls: mTLS connection (optional)
yasp-client-tls->web server (yasp): HTTP POST JSON
web server (yasp)->>yasp-server-mTLS-termination (optional): mTLS TCP
yasp-server-mTLS-termination (optional)->>remote destination (e.g. nREPL server): TCP
```
## Examples
[aleph example](https://github.com/ivarref/yasp/tree/main/aleph-example).
## Installation
Add
```clojure
{:deps {com.github.ivarref/yasp {:...}}
:aliases {:generate-keys {:deps {com.github.ivarref/locksmith {:mvn/version "0.1.6"}}
:exec-fn com.github.ivarref.locksmith/write-certs!
:exec-args {:duration-days 365}}
:proxy {:deps {com.github.ivarref/yasp-client {:git/sha "..."}}
:exec-fn com.github.ivarref.yasp-client/start-server!
:exec-args {:endpoint "http://localhost:8080/proxy"
:remote-host "127.0.0.1"
:remote-port 7777
:local-port 8888
:tls-file "client.keys"}}
}}
```
to your `deps.edn` file.
## Usage
Add an endpoint to your exposed web server that forwards the data
to yasp:
```clojure
```