Skip to content

Commit 83f570f

Browse files
authored
Merge pull request #32 from vol4tim/main
Update dependencies. Add webRTCDirect. Refactor code.
2 parents 2431c31 + 25f5b0c commit 83f570f

19 files changed

+6575
-1961
lines changed

.eslintrc.cjs

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,44 @@
11
module.exports = {
22
env: {
33
es2021: true,
4-
node: true,
4+
node: true
55
},
6-
extends: 'airbnb-base',
6+
extends: "airbnb-base",
77
overrides: [
88
{
99
env: {
10-
node: true,
10+
node: true
1111
},
12-
files: [
13-
'.eslintrc.{js,cjs}',
14-
],
12+
files: [".eslintrc.{js,cjs}"],
1513
parserOptions: {
16-
sourceType: 'script',
17-
},
18-
},
14+
sourceType: "script"
15+
}
16+
}
1917
],
2018
parserOptions: {
21-
ecmaVersion: 'latest',
22-
sourceType: 'module',
19+
ecmaVersion: "latest",
20+
sourceType: "module"
2321
},
2422
rules: {
25-
'import/no-unresolved': 'off',
26-
'import/prefer-default-export': 'off',
27-
'import/extensions': ['off', { '<js>': 'always' }],
28-
'no-plusplus': 'off',
29-
'no-console': 'off',
23+
quotes: "off",
24+
"import/extensions": ["off", { "<js>": "always" }],
25+
"comma-dangle": "off",
26+
"arrow-parens": "off",
27+
"import/prefer-default-export": "off",
28+
"no-restricted-syntax": "off",
29+
"class-methods-use-this": "off",
30+
"import/no-unresolved": "off",
31+
"no-plusplus": "off",
32+
"no-continue": "off",
33+
"operator-linebreak": "off",
34+
"implicit-arrow-linebreak": "off",
35+
"function-paren-newline": "off",
36+
"no-await-in-loop": "off",
37+
"no-console": "off"
3038
},
3139
settings: {
3240
node: {
33-
moduleDirectory: ['node_modules', 'src'],
34-
},
35-
},
41+
moduleDirectory: ["node_modules", "src"]
42+
}
43+
}
3644
};

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches: [ dev, master ]
88

99
env:
10-
NODE_VERSION: 18
10+
NODE_VERSION: 24
1111

1212
jobs:
1313
linting:
@@ -26,4 +26,4 @@ jobs:
2626
run: npm ci
2727

2828
- name: Code Linting
29-
run: npm run lint
29+
run: npm run lint

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules/
2-
peerIdJson.json
2+
config/*.json
3+
!config/*.template.json
34
.env
4-
saved_data/
5+
saved_data/

Dockerfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
FROM node:20-alpine
1+
FROM node:24-alpine
22
WORKDIR /proxy
33
RUN chown -R node:node /proxy
4-
RUN chmod -R 777 /proxy
4+
COPY src ./src
55
COPY package.json ./
66
COPY package-lock.json ./
7+
RUN mkdir config
8+
COPY config/config.template.json ./config/config.json
9+
RUN mkdir saved_data
10+
RUN chmod -R 777 /proxy
711
RUN npm ci --omit=dev
8-
COPY . .
912
ARG PORT=8888
1013
CMD [ -d "node_modules" ] && npm run start || npm ci --only=production && npm run start
11-
EXPOSE 9999
12-
USER node
14+
EXPOSE 9988 9999 9977
15+
USER node

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ Launch:
2222

2323
To enable access to the WebSocket server from another application, it is essential to establish a port mapping between the host and the container. While not mandatory, it is advisable to align the port numbers in the container and on the host.
2424
```
25-
docker run --name libp2p-proxy --detach -p 127.0.0.1:8888:8888 -p 127.0.0.1:9999:9999 ghcr.io/pinoutltd/libp2p-ws-proxy:latest
25+
curl -o- https://raw.githubusercontent.com/PinoutLTD/libp2p-ws-proxy/refs/heads/main/setup.sh | bash
26+
docker run --name libp2p-proxy --detach --network host -v ./config:/proxy/config -p 127.0.0.1:8888:8888 -p 127.0.0.1:9999:9999 ghcr.io/pinoutltd/libp2p-ws-proxy:latest
2627
```
2728

2829
To see logs:
@@ -40,7 +41,7 @@ docker stop libp2p-proxy
4041
---
4142

4243
Requirements:
43-
1. Node v.20.10.0
44+
1. Node v24.11.1
4445

4546
Installation:
4647

config/config.template.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"noAnnounce": [
3+
"/ip4/127.0.0.1/tcp/9988",
4+
"/ip4/127.0.0.1/tcp/9999/ws",
5+
"/ip4/127.0.0.1/udp/9977/webrtc-direct"
6+
],
7+
"relays": [
8+
"/dns4/libp2p-relay-2.robonomics.network/tcp/3011/p2p/12D3KooWQwEUdh5WfAUtViDpgRE2uF7AhDpc9DcsVLkHjq52xwps"
9+
]
10+
}

0 commit comments

Comments
 (0)