Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
optimize
What this PR does / why we need it (English/Chinese):
en:
document.location.host
, the default built-in server port number of Goland or other Jetbrains IDEs is 63342. At this time, it cannot be accessed normally, because the port exposed on the backend is 8080. Since the frontendJust to test the service, it is better to hardcode it directly.CheckOrigin
needs to be set totrue
, otherwise an errorwebsocket: request origin not allowed by HertzUpgrader.CheckOrigin
will be reported.zh:
document.location.host
时,Goland 或者其他 Jetbrains IDE 的默认内置服务器端口号都是63342,此时是不能正常访问的,因为在后端暴露的端口为8080,既然前端只是为了测试服务,不如直接将其写死。CheckOrigin
设置为true
,否则会报错websocket: request origin not allowed by HertzUpgrader.CheckOrigin
。Which issue(s) this PR fixes:
None.