Cloud Development Kit

WebSocket network error: WebSocket proxy authentication couldn't be handled.

We used Math of CDK.

And I used iPad device.

<iPad information>

- iPad Air2

- iOS 10.3.2

- Browser : Safari


Under the network with proxy server, we faced the attached error and couldn't use your MyScript library.

image


If we use the proxy, can't we use your library?
At least, under the network without proxy, this issue was not happened.


Hi Masashi Takahashi,

What your are describing is a proxy error. Please not that MyScript use wss (secure websocket).

Could you use this webpage from the device not working http://demos.kaazing.com/echo/ ? Please replace ws:// with wss:// and test again.

If you face the same error this is a confirmation that a proxy is causing the error.

Best regards

Pierre-Alban DEWITTE

Dear Mr. Pierre-Alban DEWITTE

Thank you so much for your reply.

 > Please not that MyScript use wss (secure websocket).

For the above your answer, shouldn't I use wss (secure websocket)?

The below is a piece of my source code.

Are there any wrong?


    MyScript.register(editorElement, {
        recognitionParams: {
            type: 'MATH',
            protocol: 'WEBSOCKET',
            apiVersion: 'V4',
            server: {
                scheme: 'https',
                host: 'webdemoapi.myscript.com',
                applicationKey: 'my applicationKey',
                hmacKey: 'my hmacKey'
            },
            v4: {
                math: {
                    mimeTypes: ['application/x-latex']
                }
            }
        }
    }

 

Also, I will try your suggestion in your commented site.


Dear Masashi Takahashi,

You are right regarding the scheme parameter. https is converted to wss when protocol is WEBSOCKET.

This should have no impact on your problem but if you intent to build a production application please use cloud.myscript.com as host. webdemoapi.myscript.com is for demo and evaluation purpose only (you will be charge the same way but cloud.myscript.com is the host where we guaranty high availability) 

Best regards

Pierre-Alban DEWITTE

Dear Mr. Pierre-Alban DEWITTE


> Could you use this webpage from the device not working http://demos.kaazing.com/echo/ ? Please replace ws:// with wss:// and test again.

> If you face the same error this is a confirmation that a proxy is causing the error.


We confirmed the above, but in the both case of ws:// and wss://, we could use "connect", "send", "close" on the device with proxy network.

(This network is the one which had proxy error in the previous day. )


Do you have another reason for it?

Or Can we confirm other check?


Masashi Takahashi.

Hi ,

We have "Handshake failed due to invalid Upgrade header" in our logs. We had a customer facing the same issue and it was cause by a reverse proxy configuration.

Here is a stackoverflow giving a way to solve this problem.

https://stackoverflow.com/questions/31211919/spring-websocket-handshake-failed-due-to-invalid-upgrade-header-null


Best regards

Pierre-Alban DEWITTE


Dear Pierre-Alban DEWITTE


Thank you so much for your reply.

Sorry for my lower understanding for Web socket.
You say that the reverse proxy setting of user's network cause this issue. Is it right?

Or, is it the setting of system's web server/javascript coding?
We use the company's proxy, so change this setting is not easy, I suppose.
If the reverse proxy setting can't be changed, then is it difficult to continue to use your application?


Best regards.

Masashi Takahashi.

Dear Masashi Takahashi,

Your understanding is right. I am pretty sure that the problem is coming from your company proxy. I could not say much about the difficulty of changing the setting but we can not do anything on our side. The only way to use our API is to use the REST (V3) mode. Of course you will not benefit from interactivity which comes with V4 but it could be enough depending of your use case.  Stay tune the REST V4 should land in the upcoming quarter.

Another way to solve this problem is to go native. We get you covered their too.

Best regards

Pierre-Alban DEWITTE



Login or Signup to post a comment