
> OS 3.5.0 or later

While "Self-hosting" allows you to switch the device connection destination to another server, **Server Mode (formerly On-Premise Mode)** configures the device to boot as a WebSocket server and wait for connections from the SDK.

This mode is available only over Wi-Fi/Ethernet. Please note that it is not possible to toggle this mode on or off via settings; it is available exclusively on dedicated devices purchased specifically for this function.

## Usage Without Cloud

obnizOS features "Local Connect," which allows a device to receive commands from a local network while still connected to the cloud. **Server Mode** is an operation mode that utilizes only this local connectivity feature, completely bypassing the cloud.

Except for cloud-related functions, all standard features of `obniz.js` (such as IO and BLE operations) are available.

```javascript
// Javascript Full Example

// Specify the device's IP address instead of the obnizID
var obniz = new Obniz("192.168.0.100");

obniz.onconnect = async function() {
  console.log(`Connected to obniz device`);
}

```

## Operating Conditions

The following conditions are required to use this mode:

| Target | Requirement |
| --- | --- |
| **Compatible Networks** | Wi-Fi, Ethernet (Wi-Fi MESH is not supported in OS 3.5.0) |
| **Network Configuration** | A Static IP or DHCP Reservation is required. |
| **TCP** | Access to Port 80 on the device must be permitted. |
| **TLS** | Unlike cloud communication, this mode uses unencrypted communication. |
| **SDK** | You must specify the device's IPv4 address in `obniz.js` instead of the obnizID. |

Additionally, there are several limitations due to the absence of a cloud connection:

* **Status Monitoring:** Online status cannot be checked via the cloud. Server Mode cannot be deactivated via the cloud.
* **Network Range:** The program using `obniz.js` must run on the same network (within the range where IPv4 TCP communication with the device is possible).
* **OTA Updates:** Over-the-air (OTA) updates must be performed from within the same local network.
