You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@submarine.apache.org by li...@apache.org on 2021/01/27 04:52:04 UTC

[submarine] branch master updated: SUBMARINE-713. Fix workbench proxy target

This is an automated email from the ASF dual-hosted git repository.

liuxun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/submarine.git


The following commit(s) were added to refs/heads/master by this push:
     new 9607b3c  SUBMARINE-713. Fix workbench proxy target
9607b3c is described below

commit 9607b3c9b9955a64245dcb48dc882c83510ddf99
Author: Byron <by...@gmail.com>
AuthorDate: Fri Jan 15 13:27:16 2021 +0800

    SUBMARINE-713. Fix workbench proxy target
    
    ### What is this PR for?
    Since we have applied the ingress controller, the port of server is switching from 8080 to 32080, and we should revise it in proxy config file.
    
    ### What type of PR is it?
    [Bug Fix]
    
    ### Todos
    * [ ] - Task
    
    ### What is the Jira issue?
    https://issues.apache.org/jira/browse/SUBMARINE-713
    
    ### How should this be tested?
    
    Author: Byron <by...@gmail.com>
    
    Signed-off-by: Liu Xun <li...@apache.org>
    
    Closes #495 from ByronHsu/PROXY_CONFIG and squashes the following commits:
    
    d9452e0 [Byron] revise target url
---
 submarine-workbench/workbench-web/proxy.conf.js | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/submarine-workbench/workbench-web/proxy.conf.js b/submarine-workbench/workbench-web/proxy.conf.js
index 3f07d6b..ccf1b71 100644
--- a/submarine-workbench/workbench-web/proxy.conf.js
+++ b/submarine-workbench/workbench-web/proxy.conf.js
@@ -24,21 +24,21 @@ dotenv.config();
 const proxyConfig = [
   {
     context: ['/api'],
-    target: 'http://localhost:8080',
+    target: 'http://localhost:32080',
     secure: false,
-    changeOrigin: true
+    changeOrigin: true,
   },
   {
     context: '/ws',
-    target: 'ws://localhost:8080',
+    target: 'ws://localhost:32080',
     secure: false,
-    ws:true,
-    changeOrigin: true
-  }
+    ws: true,
+    changeOrigin: true,
+  },
 ];
 
 function httpUrlToWSUrl(url) {
-  return url.replace(/(http)(s)?\/\//, "ws$2://");
+  return url.replace(/(http)(s)?\/\//, 'ws$2://');
 }
 
 function setupForCorporateProxy(proxyConfig) {
@@ -49,9 +49,9 @@ function setupForCorporateProxy(proxyConfig) {
     if (httpProxy) {
       agent = new HttpsProxyAgent(httpProxy);
     }
-    proxyConfig.forEach(function(entry) {
+    proxyConfig.forEach(function (entry) {
       if (entry.context === '/ws') {
-        entry.target = httpUrlToWSUrl(proxyServer)
+        entry.target = httpUrlToWSUrl(proxyServer);
       } else {
         entry.target = proxyServer;
       }


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@submarine.apache.org
For additional commands, e-mail: dev-help@submarine.apache.org