![5bb5c8aa859587b7e202c0b3280c89c5.png](https://i-blog.csdnimg.cn/blog_migrate/69c6ff2285244d225e3f46f196b1c6ed.jpeg)
前几天看到vs code有了web版,打算注册弄一个。但是怎么注册都没注册上。然后使用搜索引擎打法,发现了一个开源项目,可以在自己的服务器上搭建web版的VS-Code。接下来,我们开始吧!
项目的地址:code-server
官方给了三种部署的方式,我使用的是包部署。
首先我们要去下载这个二进制文件。
下载地址:https://github.com/cdr/code-server/releases
也可以在服务器上使用一下命令:
wget https://github.com/cdr/code-server/releases/download/2.1692-vsc1.39.2/code-server2.1692-vsc1.39.2-linux-x86_64.tar.gz
解压这个压缩包:
tar xzvf code-server2.1692-vsc1.39.2-linux-x86_64.tar.gz
进入压缩包:
cd code-server2.1692-vsc1.39.2-linux-x86_64
运行二进制文件:
./code-server
安装成功:
![333bbe5a59c97e8b29900aa8e51db110.png](https://i-blog.csdnimg.cn/blog_migrate/1115176f4601cb247e2a9de18952cfd4.jpeg)
访问服务器:
http://127.0.0.1:8080
输入密码:
![38b3c540e81653bf0a638451a2d36484.png](https://i-blog.csdnimg.cn/blog_migrate/b87d5c86930728a5c397158c4e769726.jpeg)
![46e8d467b9d519b4a0ed938a34079487.png](https://i-blog.csdnimg.cn/blog_migrate/2dcf6587642de0846e7f3b7f07f2bddb.jpeg)
安装插件,和客户端的方式相同。
更多玩法:
Usage: code-server [options][paths...]
Options
--locale <locale> The locale to use (e.g. en-US or zh-TW).
--user-data-dir <dir> Specifies the directory that user data is kept in. Can be used to open multiple distinct instances of Code.
-v --version Print version.
-h --help Print usage.
--telemetry Shows all telemetry events which VS code collects.
--extra-builtin-extensions-dir Path to an extra builtin extension directory.
--extra-extensions-dir Path to an extra user extension directory.
--base-path Base path of the URL at which code-server is hosted (used for login redirects).
--cert Path to certificate. If the path is omitted, both this and --cert-key will be generated.
--cert-key Path to the certificate's key if one was provided.
--format Format for the version. Allowed value is 'json'.
--host Host for the server.
--auth The type of authentication to use. Allowed values are 'password', 'none'.
--open Open in the browser on startup.
--port Port for the main server.
--socket Listen on a socket instead of host:port.
Extensions Management
--extensions-dir <dir> Set the root path for extensions.
--list-extensions List the installed extensions.
--show-versions Show versions of installed extensions, when using --list-extension.
--category Filters installed extensions by provided category, when using --list-extension.
--install-extension <extension-id | path-to-vsix> Installs or updates the extension. Use `--force` argument to avoid prompts.
--uninstall-extension <extension-id> Uninstalls an extension.
--enable-proposed-api <extension-id> Enables proposed API features for extensions. Can receive one or more extension IDs to enable
individually.
Troubleshooting
--verbose Print verbose output (implies --wait).
--log <level> Log level to use. Default is 'info'. Allowed values are 'critical', 'error', 'warn', 'info', 'debug', 'trace', 'off'.
-s --status Print process usage and diagnostics information.
--disable-extensions Disable all installed extensions.
--disable-extension <extension-id> Disable an extension.
--max-memory Max memory size for a window (in Mbytes).
这样就可以在Ipad上写点简单的程序了。