Skip to content

Commit 264dbe5

Browse files
committed
chore: fix websockets in local webpack server
1 parent 9b43401 commit 264dbe5

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"storybook": "start-storybook -p 9009 -s public",
1717
"build-storybook": "build-storybook -s public"
1818
},
19-
"proxy": "https://localhost:8443",
2019
"dependencies": {
2120
"@emotion/core": "10.0.28",
2221
"@emotion/styled": "10.0.27",
@@ -28,6 +27,7 @@
2827
"debug": "4.1.1",
2928
"emotion-theming": "10.0.27",
3029
"file-saver": "2.0.2",
30+
"http-proxy-middleware": "1.0.4",
3131
"i18next": "19.4.4",
3232
"i18next-browser-languagedetector": "4.1.1",
3333
"lottie-web": "5.6.8",

app/src/setupProxy.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* eslint-disable @typescript-eslint/no-var-requires */
2+
const { createProxyMiddleware } = require('http-proxy-middleware');
3+
module.exports = function (app) {
4+
app.use(
5+
'/',
6+
createProxyMiddleware(
7+
['/lnrpc.Lightning', '/looprpc.SwapClient', '/frdrpc.FaradayServer'],
8+
{
9+
target: 'https://localhost:8443',
10+
ws: true,
11+
secure: false,
12+
},
13+
),
14+
);
15+
};

app/yarn.lock

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2265,6 +2265,13 @@
22652265
resolved "https://registry.yarnpkg.com/@types/html-minifier-terser/-/html-minifier-terser-5.0.0.tgz#7532440c138605ced1b555935c3115ddd20e8bef"
22662266
integrity sha512-q95SP4FdkmF0CwO0F2q0H6ZgudsApaY/yCtAQNRn1gduef5fGpyEphzy0YCq/N0UFvDSnLg5V8jFK/YGXlDiCw==
22672267

2268+
"@types/http-proxy@^1.17.4":
2269+
version "1.17.4"
2270+
resolved "https://registry.yarnpkg.com/@types/http-proxy/-/http-proxy-1.17.4.tgz#e7c92e3dbe3e13aa799440ff42e6d3a17a9d045b"
2271+
integrity sha512-IrSHl2u6AWXduUaDLqYpt45tLVCtYv7o4Z0s1KghBCDgIIS9oW5K1H8mZG/A2CfeLdEa7rTd1ACOiHBc1EMT2Q==
2272+
dependencies:
2273+
"@types/node" "*"
2274+
22682275
"@types/is-function@^1.0.0":
22692276
version "1.0.0"
22702277
resolved "https://registry.yarnpkg.com/@types/is-function/-/is-function-1.0.0.tgz#1b0b819b1636c7baf0d6785d030d12edf70c3e83"
@@ -7475,6 +7482,17 @@ http-proxy-middleware@0.19.1:
74757482
lodash "^4.17.11"
74767483
micromatch "^3.1.10"
74777484

7485+
http-proxy-middleware@1.0.4:
7486+
version "1.0.4"
7487+
resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-1.0.4.tgz#425ea177986a0cda34f9c81ec961c719adb6c2a9"
7488+
integrity sha512-8wiqujNWlsZNbeTSSWMLUl/u70xbJ5VYRwPR8RcAbvsNxzAZbgwLzRvT96btbm3fAitZUmo5i8LY6WKGyHDgvA==
7489+
dependencies:
7490+
"@types/http-proxy" "^1.17.4"
7491+
http-proxy "^1.18.1"
7492+
is-glob "^4.0.1"
7493+
lodash "^4.17.15"
7494+
micromatch "^4.0.2"
7495+
74787496
http-proxy@^1.17.0:
74797497
version "1.18.0"
74807498
resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.18.0.tgz#dbe55f63e75a347db7f3d99974f2692a314a6a3a"
@@ -7484,6 +7502,15 @@ http-proxy@^1.17.0:
74847502
follow-redirects "^1.0.0"
74857503
requires-port "^1.0.0"
74867504

7505+
http-proxy@^1.18.1:
7506+
version "1.18.1"
7507+
resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.18.1.tgz#401541f0534884bbf95260334e72f88ee3976549"
7508+
integrity sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==
7509+
dependencies:
7510+
eventemitter3 "^4.0.0"
7511+
follow-redirects "^1.0.0"
7512+
requires-port "^1.0.0"
7513+
74877514
http-signature@~1.2.0:
74887515
version "1.2.0"
74897516
resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1"

0 commit comments

Comments
 (0)