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

fix: get host info from server instead of request host #38

Merged
merged 2 commits into from
Mar 23, 2024
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
2 changes: 1 addition & 1 deletion docs/guide/secretnote-sf.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ services:
docker compose up
```

在浏览器中(推荐使用 Chrome)通过地址 `http://127.0.0.1:8090` 打开 Web Client,并在右上角节点管理区域将两个计算节点添加进来(两个节点地址为 `127.0.0.1:8090` 和 `127.0.0.1:8092`)
在浏览器中(推荐使用 Chrome)通过地址 `http://127.0.0.1:8090` 打开 Web Client,并在右上角节点管理区域将两个计算节点添加进来(两个节点地址为 `本机IP:8090` 和 `本机IP:8092`)。注意这里添加节点的时候需要输入本机的 IP 地址,不能直接输入 `localhost` 或者 `127.0.0.1`,因为它们都指向容器自身的网络接口

![image.png](./images/node.png)

Expand Down
2 changes: 1 addition & 1 deletion pyprojects/secretnote/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"files": [
"static"
],
"version": "0.0.4",
"version": "0.0.5",
"type": "module",
"scripts": {
"format:black": "python -m black --check src tests",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ def get_host_and_port(self, server_id: str):
[host_name, port] = address.split(":")
return host_name, port

[host_name, port] = self.request.host.split(":")
server_info = self.serverapp.server_info()
host_name = server_info.get("hostname", "localhost")
port = server_info.get("port", 8888)
return host_name, port

async def http_get(self, server_id: str, proxied_path: str):
Expand Down
Loading