Skip to content

Commit 2d62b9f

Browse files
MiXaiLL76pre-commit-ci[bot]trungleduc
authored
Web based VSCODE example (#78)
* vscode web example * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update samples/code-server/README.md Co-authored-by: Duc Trung Le <[email protected]> * update readme * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Duc Trung Le <[email protected]>
1 parent 4e9381e commit 2d62b9f

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

samples/code-server/README.md

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# [VSCODE web based](https://github.com/coder/code-server) with jupyter
2+
3+
## Install vscode
4+
5+
> Run in jupyter terminal
6+
7+
```bash
8+
curl -fsSL https://code-server.dev/install.sh | sh
9+
```
10+
11+
## Setting up server parameters
12+
13+
> In the server config, you need to add the following lines.
14+
> This is necessary because to run such applications, jupyter-server-proxy is used, which uses **\_default_max_message_size** directly from the **tornado.websocket** module, and not from the **c.LabApp.tornado_settings** configuration. [websocket.py#L52](https://github.com/jupyterhub/jupyter-server-proxy/blob/76a98c900605e31a9209e0897d3010d2c6057960/jupyter_server_proxy/websocket.py#L52)
15+
16+
**jupyter_lab_config.py**
17+
18+
```py
19+
from tornado import websocket
20+
websocket_max_message_size = 1048 * 1024 * 1024
21+
# fix module
22+
setattr(websocket, "_default_max_message_size", websocket_max_message_size)
23+
# fix config
24+
c.LabApp.tornado_settings = {"websocket_max_message_size": websocket_max_message_size}
25+
```
26+
27+
## Setting up jupyter_app_launcher with open in new TAB
28+
29+
Open [juyter_app_launcher config file](https://jupyter-app-launcher.readthedocs.io/en/latest/usage.html#configuration-file-location)
30+
31+
> Add application launch parameters
32+
33+
```
34+
- title: Open VSCODE
35+
description: Open web based VSCODE
36+
icon: /usr/lib/code-server/lib/vscode/out/media/code-icon.svg
37+
source: http://localhost:$PORT/
38+
cwd: ./
39+
type: local-server
40+
args:
41+
- code-server
42+
- --auth=none
43+
- --app-name='Remote VSCode Server'
44+
- --disable-telemetry
45+
- --disable-update-check
46+
- --disable-workspace-trust
47+
- --bind-addr=0.0.0.0:$PORT
48+
catalog: VSCODE
49+
```

0 commit comments

Comments
 (0)