Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change ports for skychat, skysocks, hypervisor API/UI #294

Merged
merged 2 commits into from
Apr 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ $ docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' S
#### 3. Open in browser containerized `skychat` application

```bash
$ firefox http://$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' SKY01):8000
$ firefox http://$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' SKY01):8001
```

#### 4. Create new dockerized `skywire-visor`s
Expand Down Expand Up @@ -410,7 +410,7 @@ $ docker run -it -v /tmp/SKYNODE:/sky --network=SKYNET --name=SKYNODE skywire-ru
# [2019-03-15T13:55:10Z] INFO [trmanager]: Starting transport manager
# [2019-03-15T13:55:10Z] INFO [router]: Got new App request with type Init: {"app-name":"skychat",# "app-version":"1.0","protocol-version":"0.0.1"}
# [2019-03-15T13:55:10Z] INFO [router]: Handshaked new connection with the app skychat.v1.0
# [2019-03-15T13:55:10Z] INFO [skychat.v1.0]: 2019/03/15 13:55:10 Serving HTTP on :8000
# [2019-03-15T13:55:10Z] INFO [skychat.v1.0]: 2019/03/15 13:55:10 Serving HTTP on :8001
# [2019-03-15T13:55:10Z] INFO [router]: Got new App request with type Init: {"app-name":"skysocks",# "app-version":"1.0","protocol-version":"0.0.1"}
# [2019-03-15T13:55:10Z] INFO [router]: Handshaked new connection with the app skysocks.v1.0
```
Expand Down Expand Up @@ -440,13 +440,13 @@ Idea of test from Erlang classics: <https://youtu.be/uKfKtXYLG78?t=120>
$ make run
$ make docker-run
# Open in browser skychat application
$ firefox http://$SW_VISOR_B:8000 &
$ firefox http://$SW_VISOR_B:8001 &
# add transport
$ ./skywire-cli add-transport $SW_VISOR_B_PK
# "Hello Mike!" - "Hello Joe!" - "System is working!"
$ curl --data {'"recipient":"'$SW_VISOR_A_PK'", "message":"Hello Mike!"}' -X POST http://$SW_VISOR_B:8000/message
$ curl --data {'"recipient":"'$SW_VISOR_B_PK'", "message":"Hello Joe!"}' -X POST http://$SW_VISOR_A:8000/message
$ curl --data {'"recipient":"'$SW_VISOR_A_PK'", "message":"System is working!"}' -X POST http://$SW_VISOR_B:8000/message
$ curl --data {'"recipient":"'$SW_VISOR_A_PK'", "message":"Hello Mike!"}' -X POST http://$SW_VISOR_B:8001/message
$ curl --data {'"recipient":"'$SW_VISOR_B_PK'", "message":"Hello Joe!"}' -X POST http://$SW_VISOR_A:8001/message
$ curl --data {'"recipient":"'$SW_VISOR_A_PK'", "message":"System is working!"}' -X POST http://$SW_VISOR_B:8001/message
# Teardown
$ make stop && make docker-stop
```
Expand Down
4 changes: 2 additions & 2 deletions cmd/apps/skychat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Create 2 visor config files:
"version": "1.0",
"auto_start": true,
"port": 1,
"args": ["-addr", ":8001"]
"args": ["-addr", ":8002"]
}
]
}
Expand All @@ -49,4 +49,4 @@ $ ./skywire-visor skywire1.json
$ ./skywire-visor skywire2.json
```

Chat interface will be available on ports `8000` and `8001`.
Chat interface will be available on ports `8001` and `8002`.
2 changes: 1 addition & 1 deletion cmd/apps/skychat/chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const (
port = routing.Port(1)
)

var addr = flag.String("addr", ":8000", "address to bind")
var addr = flag.String("addr", ":8001", "address to bind")
var r = netutil.NewRetrier(50*time.Millisecond, 5, 2)

var (
Expand Down
2 changes: 1 addition & 1 deletion cmd/apps/skysocks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,5 @@ $ ./skywire-visor skywire2.json
You should be able to connect to a secondary visor via `curl`:

```sh
$ curl -v -x socks5://123456:@localhost:1080 https://api.ipify.org
$ curl -v -x socks5://123456:@localhost:9443 https://api.ipify.org
```
4 changes: 2 additions & 2 deletions cmd/hypervisor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ $ hypervisor gen-config
$ hypervisor --mock
```

By default, the RESTful API is served on `:8080`.
By default, the RESTful API is served on `:8000`.

## Endpoints Documentation

Endpoints are documented in the provided [Postman](https://www.getpostman.com/) file: `hypervisor.postman_collection.json`.

## Web UI

UI is served on the same port as the API (`:8080` by default). Directory to search for the build frontend is passed in the `web_dir` field of the hypervisor's config.
UI is served on the same port as the API (`:8000` by default). Directory to search for the build frontend is passed in the `web_dir` field of the hypervisor's config.

### Authentication information

Expand Down
80 changes: 40 additions & 40 deletions cmd/hypervisor/hypervisor.postman_collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
"raw": ""
},
"url": {
"raw": "http://localhost:8080/api/visors",
"raw": "http://localhost:8000/api/visors",
"protocol": "http",
"host": [
"localhost"
],
"port": "8080",
"port": "8000",
"path": [
"api",
"visors"
Expand All @@ -39,12 +39,12 @@
"raw": ""
},
"url": {
"raw": "http://localhost:8080/api/visors",
"raw": "http://localhost:8000/api/visors",
"protocol": "http",
"host": [
"localhost"
],
"port": "8080",
"port": "8000",
"path": [
"api",
"visors"
Expand Down Expand Up @@ -83,12 +83,12 @@
"raw": ""
},
"url": {
"raw": "http://localhost:8080/api/visors/021c535e45756c63151820c8f31bfbb0efd6d7d49305e133e1650aae889d60ff02",
"raw": "http://localhost:8000/api/visors/021c535e45756c63151820c8f31bfbb0efd6d7d49305e133e1650aae889d60ff02",
"protocol": "http",
"host": [
"localhost"
],
"port": "8080",
"port": "8000",
"path": [
"api",
"visors",
Expand All @@ -115,12 +115,12 @@
"raw": ""
},
"url": {
"raw": "http://localhost:8080/api/visors/02500488fc25814e55e6c740537ed14ca677aebe8a883681bae718a36516a7b0a2",
"raw": "http://localhost:8000/api/visors/02500488fc25814e55e6c740537ed14ca677aebe8a883681bae718a36516a7b0a2",
"protocol": "http",
"host": [
"localhost"
],
"port": "8080",
"port": "8000",
"path": [
"api",
"visors",
Expand Down Expand Up @@ -167,12 +167,12 @@
"raw": ""
},
"url": {
"raw": "http://localhost:8080/api/visors/021c535e45756c63151820c8f31bfbb0efd6d7d49305e133e1650aae889d60ff02/apps",
"raw": "http://localhost:8000/api/visors/021c535e45756c63151820c8f31bfbb0efd6d7d49305e133e1650aae889d60ff02/apps",
"protocol": "http",
"host": [
"localhost"
],
"port": "8080",
"port": "8000",
"path": [
"api",
"visors",
Expand All @@ -193,12 +193,12 @@
"raw": ""
},
"url": {
"raw": "http://localhost:8080/api/visors/02500488fc25814e55e6c740537ed14ca677aebe8a883681bae718a36516a7b0a2/apps",
"raw": "http://localhost:8000/api/visors/02500488fc25814e55e6c740537ed14ca677aebe8a883681bae718a36516a7b0a2/apps",
"protocol": "http",
"host": [
"localhost"
],
"port": "8080",
"port": "8000",
"path": [
"api",
"visors",
Expand Down Expand Up @@ -239,12 +239,12 @@
"raw": ""
},
"url": {
"raw": "http://localhost:8080/api/visors/021c535e45756c63151820c8f31bfbb0efd6d7d49305e133e1650aae889d60ff02/apps/foo.v1.0",
"raw": "http://localhost:8000/api/visors/021c535e45756c63151820c8f31bfbb0efd6d7d49305e133e1650aae889d60ff02/apps/foo.v1.0",
"protocol": "http",
"host": [
"localhost"
],
"port": "8080",
"port": "8000",
"path": [
"api",
"visors",
Expand All @@ -266,12 +266,12 @@
"raw": ""
},
"url": {
"raw": "http://localhost:8080/api/visors/02500488fc25814e55e6c740537ed14ca677aebe8a883681bae718a36516a7b0a2/apps/foo.v1.0/start",
"raw": "http://localhost:8000/api/visors/02500488fc25814e55e6c740537ed14ca677aebe8a883681bae718a36516a7b0a2/apps/foo.v1.0/start",
"protocol": "http",
"host": [
"localhost"
],
"port": "8080",
"port": "8000",
"path": [
"api",
"visors",
Expand Down Expand Up @@ -321,12 +321,12 @@
"raw": "{\n\t\"autostart\": true,\n\t\"status\": 1\n}"
},
"url": {
"raw": "http://localhost:8080/api/visors/023ab9f45c0eb3625f9848a9ff6822c6d0965a94d3e7955f1869f38153df0e5b64/apps/foo.v1.0",
"raw": "http://localhost:8000/api/visors/023ab9f45c0eb3625f9848a9ff6822c6d0965a94d3e7955f1869f38153df0e5b64/apps/foo.v1.0",
"protocol": "http",
"host": [
"localhost"
],
"port": "8080",
"port": "8000",
"path": [
"api",
"visors",
Expand Down Expand Up @@ -355,12 +355,12 @@
"raw": "{\n\t\"autostart\": true,\n\t\"status\": 1\n}"
},
"url": {
"raw": "http://localhost:8080/api/visors/023ab9f45c0eb3625f9848a9ff6822c6d0965a94d3e7955f1869f38153df0e5b64/apps/foo.v1.0",
"raw": "http://localhost:8000/api/visors/023ab9f45c0eb3625f9848a9ff6822c6d0965a94d3e7955f1869f38153df0e5b64/apps/foo.v1.0",
"protocol": "http",
"host": [
"localhost"
],
"port": "8080",
"port": "8000",
"path": [
"api",
"visors",
Expand Down Expand Up @@ -402,12 +402,12 @@
"raw": ""
},
"url": {
"raw": "http://localhost:8080/api/visors/023ab9f45c0eb3625f9848a9ff6822c6d0965a94d3e7955f1869f38153df0e5b64/transport-types",
"raw": "http://localhost:8000/api/visors/023ab9f45c0eb3625f9848a9ff6822c6d0965a94d3e7955f1869f38153df0e5b64/transport-types",
"protocol": "http",
"host": [
"localhost"
],
"port": "8080",
"port": "8000",
"path": [
"api",
"visors",
Expand All @@ -428,12 +428,12 @@
"raw": ""
},
"url": {
"raw": "http://localhost:8080/api/visors/039337a306ffbd6a7495f79b65aec91ce65756e4fd1cb2cd726840b2eee4fa59c2/transport-types",
"raw": "http://localhost:8000/api/visors/039337a306ffbd6a7495f79b65aec91ce65756e4fd1cb2cd726840b2eee4fa59c2/transport-types",
"protocol": "http",
"host": [
"localhost"
],
"port": "8080",
"port": "8000",
"path": [
"api",
"visors",
Expand Down Expand Up @@ -474,12 +474,12 @@
"raw": ""
},
"url": {
"raw": "http://localhost:8080/api/visors/023ab9f45c0eb3625f9848a9ff6822c6d0965a94d3e7955f1869f38153df0e5b64/transports?logs=true",
"raw": "http://localhost:8000/api/visors/023ab9f45c0eb3625f9848a9ff6822c6d0965a94d3e7955f1869f38153df0e5b64/transports?logs=true",
"protocol": "http",
"host": [
"localhost"
],
"port": "8080",
"port": "8000",
"path": [
"api",
"visors",
Expand Down Expand Up @@ -507,12 +507,12 @@
"raw": ""
},
"url": {
"raw": "http://localhost:8080/api/visors/039337a306ffbd6a7495f79b65aec91ce65756e4fd1cb2cd726840b2eee4fa59c2/transports?logs=true",
"raw": "http://localhost:8000/api/visors/039337a306ffbd6a7495f79b65aec91ce65756e4fd1cb2cd726840b2eee4fa59c2/transports?logs=true",
"protocol": "http",
"host": [
"localhost"
],
"port": "8080",
"port": "8000",
"path": [
"api",
"visors",
Expand Down Expand Up @@ -567,12 +567,12 @@
"raw": "{\n\t\"remote_pk\": \"03c497380efd87e19208bb484ee322ede1e091b2a0b653e6d25475f641602376a9\",\n\t\"transport_type\": \"native\",\n\t\"public\": true\n}"
},
"url": {
"raw": "http://localhost:8080/api/visors/023ab9f45c0eb3625f9848a9ff6822c6d0965a94d3e7955f1869f38153df0e5b64/transports",
"raw": "http://localhost:8000/api/visors/023ab9f45c0eb3625f9848a9ff6822c6d0965a94d3e7955f1869f38153df0e5b64/transports",
"protocol": "http",
"host": [
"localhost"
],
"port": "8080",
"port": "8000",
"path": [
"api",
"visors",
Expand Down Expand Up @@ -600,12 +600,12 @@
"raw": "{\n\t\"remote_pk\": \"03c497380efd87e19208bb484ee322ede1e091b2a0b653e6d25475f641602376a9\",\n\t\"transport_type\": \"native\",\n\t\"public\": true\n}"
},
"url": {
"raw": "http://localhost:8080/api/visors/039337a306ffbd6a7495f79b65aec91ce65756e4fd1cb2cd726840b2eee4fa59c2/transports",
"raw": "http://localhost:8000/api/visors/039337a306ffbd6a7495f79b65aec91ce65756e4fd1cb2cd726840b2eee4fa59c2/transports",
"protocol": "http",
"host": [
"localhost"
],
"port": "8080",
"port": "8000",
"path": [
"api",
"visors",
Expand Down Expand Up @@ -646,12 +646,12 @@
"raw": ""
},
"url": {
"raw": "http://localhost:8080/api/visors/023ab9f45c0eb3625f9848a9ff6822c6d0965a94d3e7955f1869f38153df0e5b64/transports/70836b44-f6e5-4c17-a5e8-e1cbef89a10f",
"raw": "http://localhost:8000/api/visors/023ab9f45c0eb3625f9848a9ff6822c6d0965a94d3e7955f1869f38153df0e5b64/transports/70836b44-f6e5-4c17-a5e8-e1cbef89a10f",
"protocol": "http",
"host": [
"localhost"
],
"port": "8080",
"port": "8000",
"path": [
"api",
"visors",
Expand All @@ -673,12 +673,12 @@
"raw": ""
},
"url": {
"raw": "http://localhost:8080/api/visors/039337a306ffbd6a7495f79b65aec91ce65756e4fd1cb2cd726840b2eee4fa59c2/transports/2ff2d608-fe14-4c17-938c-3af8afd053ae",
"raw": "http://localhost:8000/api/visors/039337a306ffbd6a7495f79b65aec91ce65756e4fd1cb2cd726840b2eee4fa59c2/transports/2ff2d608-fe14-4c17-938c-3af8afd053ae",
"protocol": "http",
"host": [
"localhost"
],
"port": "8080",
"port": "8000",
"path": [
"api",
"visors",
Expand Down Expand Up @@ -720,12 +720,12 @@
"raw": ""
},
"url": {
"raw": "http://localhost:8080/api/visors/023ab9f45c0eb3625f9848a9ff6822c6d0965a94d3e7955f1869f38153df0e5b64/transports/d5ace20e-06c8-4867-bda2-9449459a9e5a",
"raw": "http://localhost:8000/api/visors/023ab9f45c0eb3625f9848a9ff6822c6d0965a94d3e7955f1869f38153df0e5b64/transports/d5ace20e-06c8-4867-bda2-9449459a9e5a",
"protocol": "http",
"host": [
"localhost"
],
"port": "8080",
"port": "8000",
"path": [
"api",
"visors",
Expand All @@ -747,12 +747,12 @@
"raw": ""
},
"url": {
"raw": "http://localhost:8080/api/visors/039337a306ffbd6a7495f79b65aec91ce65756e4fd1cb2cd726840b2eee4fa59c2/transports/2ff2d608-fe14-4c17-938c-3af8afd053ae",
"raw": "http://localhost:8000/api/visors/039337a306ffbd6a7495f79b65aec91ce65756e4fd1cb2cd726840b2eee4fa59c2/transports/2ff2d608-fe14-4c17-938c-3af8afd053ae",
"protocol": "http",
"host": [
"localhost"
],
"port": "8080",
"port": "8000",
"path": [
"api",
"visors",
Expand Down
2 changes: 1 addition & 1 deletion pkg/hypervisor/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

const (
defaultWebDir = "./static/skywire-manager-src/dist"
defaultHTTPAddr = ":8080"
defaultHTTPAddr = ":8000"
defaultCookieExpiration = 12 * time.Hour
hashKeyLen = 64
blockKeyLen = 32
Expand Down
Loading