VSX CompatibleOXP Native: Planned

// Description

A better Live Server with instant updates, highlights and some PHP support.

// Readme

Open VSX
  • ›⚡️ Updates your files instantly while typing on your keyboard
  • ›⬢ Shows the logs of your browser or phone in your terminal
  • ›💡 Highlights the code you are working on in your browser
  • ›🚀 Navigates your browser automatically to the current editing file
  • ›🐘 Includes PHP Support for serving and live reload all your .php files
  • ›🗄️ Supports all Server Side Rendered Apps like express.js

##Get Started

4 ways to start your live server.

  1. ›Click Go Live in the Status Bar (bottom of VSCode)
  2. ›Right-Click an Open File > Open with Five Server
  3. ›Right-Click a File in the Explorer > Open with Five Server
  4. ›Right-Click a Folder in the Explorer > Open with Five Server (root)
    (will set the current folder as root until you stop the server)

To stop the server, click the Go Live item in the Status Bar again, or run Five-Server: Close from the Command Palette.

Keyboard shortcuts (while the editor has focus):

  • ›Alt+L Alt+O opens the current file with Five Server (Cmd+L Cmd+O on macOS).
  • ›Alt+L Alt+C closes Five Server (Cmd+L Cmd+C on macOS).

##Videos

##Quick Test

Something is not working? Try the simple setup below:

  • ›make sure you have uninstalled the old Live Server
  • ›check if you have the latest version
    VERSION
  • ›make a new folder www on the desktop
  • ›add the index.html (see below)
  • ›open the folder www with VSCode
  • ›click on Go Live
<!DOCTYPE html>
<html>
  <head>
    <title>HTML Test File</title>
  </head>
  <body>
    <h1>It works!</h1>
  </body>
</html>

The setup above works but your project not?

  • ›Maybe because your project is on another drive?
  • ›Or maybe on a USB Stick or remote folder like OneDrive or Dropbox?
  • ›Make sure you open a folder in VSCode and NOT just a single file.
  • ›All these things can sometimes cause issues.

##About PHP

Although Five Server can render, display and live reload PHP, it does not provide a full PHP server. If you want to develop a big PHP app, you manually have to link the client-side Five Server script with your PHP files. See five-server-with-php.

To serve .php files, set the path to your PHP executable in the settings with fiveServer.php.executable. Use fiveServer.php.ini to point to a php.ini file.

##Features

💡 Most advanced features are disabled by default.
Turn them on in the settings or by configuring a config file in the root of your workspace. The config file can be named fiveserver.config.js (or .cjs / .mjs), or .fiveserverrc (or .fiveserverrc.json, .js, .cjs, .mjs). The config file is read each time the server starts, so restart the server after you change it.

Note:

  • ›Instant Update & Highlight work with .html and .php files.
  • ›Instant Update needs injectBody.
  • ›Auto navigation (navigate) only opens .html and .php files that contain a </head>, </body> or </html> tag.
  • ›Opening a file that is not .html or .php, such as a .js or .css file, shows a preview of that file.
  • ›All remote logs will be visible in a new Terminal called "Five Server".
  • ›The features highlight, injectBody, navigate and remoteLogs are disabled by default.
  • ›To use the highlight feature, injectBody has to be activated.
  • ›Dotfiles such as .env are hidden by default. Set fiveServer.dotFiles in the settings, or dotFiles: true in the config file, to serve them. The .git folder is always hidden.
  • ›injectBody performs some simple HTML Validation. When using injectBody, a message will be displayed if your HTML Page is invalid.
  • ›To temporarily disable highlight for a single HTML Tag, add a H.
    Example: <div H>Don't highlight me</div>

Config File Example:

// fiveserver.config.js
module.exports = {
  highlight: true, // enable highlight feature
  injectBody: true, // enable instant update
  remoteLogs: "yellow", // enable remoteLogs and use the color yellow (true | false | Color)
  injectCss: false, // disable injecting css
  navigate: true, // enable auto-navigation
  dotFiles: false, // serve dotfiles such as .env (hidden by default)
};

###Settings

These settings are available in VS Code under Settings > Extensions > Five Server, or in settings.json. A value in the config file overrides the matching setting.

SettingDefaultDescription
fiveServer.host127.0.0.1Address to listen on. See Host and Network Access.
fiveServer.port5500Port of the server.
fiveServer.corstrueOrigins allowed to read responses. See CORS.
fiveServer.dotFilesfalseServe dotfiles such as .env.
fiveServer.injectBodyfalseEnable Instant Update.
fiveServer.highlightfalseHighlight the code you are editing in the browser. Needs injectBody.
fiveServer.navigatefalseOpen the page of the file you are editing.
fiveServer.browser[]Browser to open, e.g. "chrome".
fiveServer.ignore[]Files and folders to ignore while watching.
fiveServer.openTerminalfalseShow the Five Server terminal when the server starts.
fiveServer.php.executable""Path to the PHP executable.
fiveServer.php.ini""Path to a php.ini file.

###Host and Network Access

fiveServer.host (settings) or host (config file) sets the address Five Server listens on. The default is 127.0.0.1, so only your own computer can connect.

hostWho can connect
127.0.0.1 (default)This computer only
0.0.0.0Any device on your network, such as a phone or tablet
another address, e.g. 192.168.1.20Only that address

To test on a phone on the same Wi-Fi, set host to 0.0.0.0. Five Server then prints a Network URL in the terminal. Open that URL on your phone.

// fiveserver.config.js
module.exports = {
  host: "0.0.0.0",
};

Warning: 0.0.0.0 makes your project files reachable by every device on the network. Use it only on networks you trust, such as your home network. Do not use it on public Wi-Fi.

###CORS

Cross-origin requests happen when a page on one origin reads a response from another origin. An origin is the scheme, host, and port. For example, a frontend on http://localhost:3000 that fetches data from Five Server on port 5500 makes a cross-origin request. The cors option controls which origins may read Five Server's responses.

fiveServer.corsOrigins that may read responses
true (default)This computer (localhost, 127.0.0.1, [::1]) on any port. If host is 0.0.0.0 or a LAN address, your private network too (10.x.x.x, 172.16.x.x to 172.31.x.x, 192.168.x.x).
falseNone. Five Server sends no CORS headers.
a list, e.g. ["http://localhost:3000"]Only the listed origins. Strings must match exactly, including the port.

The config file accepts two more forms: a regular expression in the list, and '*', which allows any origin. '*' is unsafe because any website you visit can read Five Server's responses.

// fiveserver.config.js
module.exports = {
  cors: ["http://localhost:3000", "http://192.168.1.26:5173"],
};

Pages that Five Server serves itself are same-origin, so they do not need CORS. To reach a backend that has no CORS headers, use the proxy option in the config file.

If both a setting and the config file set the same option, the config file wins. Use the settings for your defaults and the config file for per-project changes.

###More Docs

###Known Issues

  • ›Sometimes injectBody does not work well when using inline JavaScript inside <body>.
    As a workaround, execute your inline scripts after Five Server is connected:
<script>
  const main = () => {
    console.log("Some JavaScript Code...");
  };

  // wait for five-server to connect
  const five = document.querySelector('[data-id="five-server"]');
  if (five) five.addEventListener("connected", main);
  else window.addEventListener("load", main);
</script>

###Debug Mode

Need to debug something? Set debugVSCode to true in the config file. It is not available as a setting. Debug messages are written to the Five Server terminal.

// fiveserver.config.js
module.exports = {
  debugVSCode: true,
};

##Release Notes

No release notes while < v1.0.0

##Support Five Server

GitHub Sponsors
One-Time Donation

// Install

Open this extension directly in your IDE — no CLI, no extra tools.

Extension ID
yandeu.five-server

If your IDE doesn't open automatically, copy the ID above and paste it into the Extensions view (⌘P → ext install <id>).

// Source signals

Publisher
Verified ✓
Rating
5.0 (3)
Downloads
650.4k
Published
2026-11-09
License
SEE LICENSE IN LICENSE
Source
repo
Homepage
link

Live from open-vsx.org. Refreshed hourly.

// Are you the author?

This listing is mirrored from Open VSX. Claim it to ship a native OXP build, customise the page, and respond to reviews.

Claim this listing

// Package Info

Version
0.4.0
Owner
@vsx-yandeu
Downloads
377.1k
Stars
0