Skip to content

Latest commit

 

History

History
60 lines (48 loc) · 1.18 KB

README.md

File metadata and controls

60 lines (48 loc) · 1.18 KB

hidden-echo-service

https://habr.com/ru/articles/839950/

Example of simple application in the «Hidden Lake» anonymity network. The configuration file of the production environment is used.

Download HLS

$ wget https://github.com/number571/hidden-lake/releases/latest/download/hls_amd64_linux && \
    mv hls_amd64_linux hls && \
    chmod +x hls && \
    cp hls client/hls

Running

Terminal 1 (running echo-service):

$ go run ./main.go

Terminal 2 (running HLS service-node):

$ ./hls

Terminal 3 (running HLS client-node):

$ cd client && ./hls

Request

Do request:

curl -i -X POST http://localhost:9572/api/network/request --data '{
    "receiver":"service-node",
    "req_data":{
        "method":"POST",
        "host":"hidden-echo-service",
        "path":"/echo",
        "body":"aGVsbG8sIHdvcmxkIQ=="
    }
}'

Get response:

HTTP/1.1 200 OK
Content-Type: text/plain
Date: Sun, 04 Aug 2024 09:59:50 GMT
Content-Length: 102

{"code":200,"head":{"Content-Type":"text/plain; charset=utf-8"},"body":"ZWNobyhoZWxsbywgd29ybGQhKQ=="}
echo "ZWNobyhoZWxsbywgd29ybGQhKQ==" | base64 -d
# echo(hello, world!)