Hello.
I wanted to return a custom response in case the requested host does not exist or host is down. I am using ExplicitEndpoint and tried to produce a response in ExceptionFunc, but there are two problems in the current implementation of TWP.
If it was not possible to resolve the DNS name or the host is down, then a SocketException with the corresponding SocketErrorCode is thrown. For 'http' requests, the current implementation throws a ProxyHttpException with inner SocketException, it has access to the 'Session' and you can call 'Respond', but this response will not be sent to the client.
In case of 'Connect' requests for 'https', only SocketException is passed to ExceptionFunc, and '200 Connection Established' are given to the client even before the connection with the remote host is made.
I wanted to know if any changes are planned for ability to make custom responses in case of this kind of a SocketException?
Or maybe there is another way to implement this functionality?
Hello. I wanted to return a custom response in case the requested host does not exist or host is down. I am using ExplicitEndpoint and tried to produce a response in ExceptionFunc, but there are two problems in the current implementation of TWP.
I wanted to know if any changes are planned for ability to make custom responses in case of this kind of a SocketException? Or maybe there is another way to implement this functionality?