You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by "Jesus Alvarez (JIRA)" <ji...@apache.org> on 2017/06/23 01:57:00 UTC

[jira] [Comment Edited] (KNOX-776) Rewrite rule handling for Websockets

    [ https://issues.apache.org/jira/browse/KNOX-776?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16060302#comment-16060302 ] 

Jesus Alvarez edited comment on KNOX-776 at 6/23/17 1:56 AM:
-------------------------------------------------------------

Patch attached. 

As the ambari service definitions for Zeppelin include the Service URL "/ws", I have added a snippet to not introduce any regression:

_if (!StringUtils.endsWith(backend.toString(), "/ws"))
  backend.append(pathService[1]);_

The logic added will find the backend url path from *<protocol>://<host>:<port>/<path>* and append the *<path>* to the Service URL. 

For Zeppelin, the Service URL in ambari has "/ws" hard coded, so the check will simply skip appending if a backend url for zepplen is detected <protocol>://<host>:<port>/"ws" to avoid any regression with current zeppelin setups.


[KNOX-894][https://issues.apache.org/jira/browse/KNOX-894] looks like a duplicate of this Jira. The endpoints listed there should all resolve with these new rewrite rules in place.


# Zeppelin ws test
 2017-06-22 18:22:17,594 DEBUG gateway.websockets (ProxyWebSocketAdapter.java:onWebSocketConnect(87)) - Websocket connection to backend server ws://cowan1.fyre.ibm.com:9995/ws opened

\# jupyter kernel gateway websocket test
2017-06-22 18:31:35,685 DEBUG server.Server (Server.java:handle(502)) - RESPONSE /gateway/default/jkgws/api/kernels/6e85921f-b2ec-4e21-9ae5-5879da835e33/channels  101 handled=true

\# gateway-server tests
Tests run: 103, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 30.155s
[INFO] Finished at: Thu Jun 22 15:03:42 PDT 2017
[INFO] Final Memory: 22M/444M


was (Author: jesus.alv):
Patch attached. 

As the ambari service definitions for Zeppelin include the Service URL "/ws", I have added a snippet to not introduce any regression:

{{if (!StringUtils.endsWith(backend.toString(), "/ws"))
  backend.append(pathService[1]);}}

The logic added will find the backend url path from *<protocol>://<host>:<port>/<path>* and append the *<path>* to the Service URL. 

For Zeppelin, the Service URL in ambari has "/ws" hard coded, so the check will simply skip appending if a backend url for zepplen is detected <protocol>://<host>:<port>/"ws" to avoid any regression with current zeppelin setups.


[KNOX-894][https://issues.apache.org/jira/browse/KNOX-894] looks like a duplicate of this Jira. The endpoints listed there should all resolve with these new rewrite rules in place.


# Zeppelin ws test
 2017-06-22 18:22:17,594 DEBUG gateway.websockets (ProxyWebSocketAdapter.java:onWebSocketConnect(87)) - Websocket connection to backend server ws://cowan1.fyre.ibm.com:9995/ws opened

# jupyter kernel gateway websocket test
2017-06-22 18:31:35,685 DEBUG server.Server (Server.java:handle(502)) - RESPONSE /gateway/default/jkgws/api/kernels/6e85921f-b2ec-4e21-9ae5-5879da835e33/channels  101 handled=true

# gateway-server tests
Tests run: 103, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 30.155s
[INFO] Finished at: Thu Jun 22 15:03:42 PDT 2017
[INFO] Final Memory: 22M/444M

> Rewrite rule handling for Websockets
> ------------------------------------
>
>                 Key: KNOX-776
>                 URL: https://issues.apache.org/jira/browse/KNOX-776
>             Project: Apache Knox
>          Issue Type: Bug
>          Components: Server
>            Reporter: Sandeep More
>            Assignee: Jesus Alvarez
>             Fix For: 0.14.0
>
>         Attachments: KNOX-776.patch
>
>
> Currently we simply proxy websocket payload we should support some form of rewrite rule handling.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)