shuoshadow commented on issue #495:
URL:
https://github.com/apache/apisix-ingress-controller/issues/495#issuecomment-848507043
> @shuoshadow How did you send requests? Please give us a minimal
reproducible case.
frontend
const initSocket = () => {
const socketURI =
`${WEBSOCKET_URL_OBJ[props.namespace]}/api/v1/pod/exec/${props.namespace}/${props.podName}`
socketRef.current = new WebSocket(socketURI)
socketOnClose()
socketOnOpen()
socketOnError()
}
const socketOnClose = () => {
socketRef.current.onclose = () => {
socketRef.current.close()
termRef.current.write('connet is closed!!!')
console.log('close socket')
}
}
const socketOnOpen = () => {
socketRef.current.onopen = () => {
initTerm()
}
}
backend:
logger.Debug("in ExecPod")
if !ctx.IsWebsocket() {
ctx.JSON(http.StatusUnsupportedMediaType,
hr.ErrResponse{hr.ErrorData{hr.ErrorCodePodExecError, "===not websocket
request==="}})
return
}
it works right by nginx-ingress
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]