-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Support Server-Sent-Events? #2029
Comments
the request header is
|
So shall we check the header like this? |
I don't think this is the best solution. But |
Maybe can let the user to specify ignore route timeout? Lines 131 to 137 in 86d7031
replace: func (ng *engine) checkedTimeout(timeout time.Duration, ignoreTimeout bool) time.Duration {
if ignoreTimeout {
// ignore timeout
return -1
}
if timeout > 0 {
return timeout
}
return time.Duration(ng.conf.Timeout) * time.Millisecond
} Lines 33 to 40 in 86d7031
replace: featuredRoutes struct {
timeout time.Duration
priority bool
jwt jwtSetting
signature signatureSetting
routes []Route
maxBytes int64
ignoreTimeout bool
} // WithIgnoreTimeout returns a RunOption to ignore the timeout.
func WithIgnoreTimeout() RouteOption {
return func(r *featuredRoutes) {
r.ignoreTimeout = true
}
} |
Pretty good. |
This issue is stale because it has been open for 30 days with no activity. |
This issue was closed because it has been inactive for 14 days since being marked as stale. |
the issue is still exist |
issue is still exist @kevwan |
Name: client-api |
@i255979 这样是可以绕过;但是有个问题所有的接口都没有超时设置了 |
@i255979 This can be bypassed; but there is a problem that all interfaces have no timeout settings |
Createing a new route can resolve this issue, demo: server.AddRoute(rest.Route{
Method: http.MethodGet,
Path: "xx",
Handler: lottery.CurrentLotteryStateEventHandler(ctx),
}, rest.WithTimeout(xxx)) only this route uses this timeout, other routers timeout from conf. |
To add to the previous comment
|
Is your feature request related to a problem? Please describe.
Go-zero unsupport
SSE
without set global configTimeout
to0
. When i want to useSSE
, must to set Header {"upgrade": "websocket"}. But chrome unsupport change headerUpgrade
Describe the solution you'd like
A clear and concise description of what you want to happen.
Add a new header to identify the request SSE.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Add new config for
SSE
. If setSSE
config, skiptimeoutHandler
Additional context
Add any other context or screenshots about the feature request here.
scheme 1
PR: #2028
scheme 2
The text was updated successfully, but these errors were encountered: