# connect

[[Source]](https://github.com/XRPLF/rippled/blob/master/src/xrpld/rpc/handlers/Connect.cpp)

The `connect` command forces the `rippled` server to connect to a specific peer server.

*The `connect` method is an [admin method](/docs/references/http-websocket-apis/admin-api-methods) that cannot be run by unprivileged users!*

### Request Format

An example of the request format:

WebSocket

```json
{
    "command": "connect",
    "ip": "192.170.145.88",
    "port": 51235
}
```

JSON-RPC

```json
{
    "method": "connect",
    "params": [
        {
            "ip": "192.170.145.88",
            "port": 51235
        }
    ]
}
```

Commandline

```sh
#Syntax: connect ip [port]
rippled connect 192.170.145.88 51235
```

The request includes the following parameters:

| `Field` | Type | Description |
|  --- | --- | --- |
| `ip` | String | IP address of the server to connect to |
| `port` | Number | *(Optional)* Port number to use when connecting. The default is **2459**. Updated in: rippled 1.6.0 |


### Response Format

An example of a successful response:

JSON-RPC

```json
{
   "result" : {
      "message" : "connecting",
      "status" : "success"
   }
}
```

Commandline

```json
Loading: "/etc/rippled.cfg"
Connecting to 127.0.0.1:5005

{
   "result" : {
      "message" : "connecting",
      "status" : "success"
   }
}
```

The response follows the [standard format](/docs/references/http-websocket-apis/api-conventions/response-formatting), with a successful result containing the following fields:

| `Field` | Type | Description |
|  --- | --- | --- |
| `message` | String | The value `connecting`, if the command was successful. |


### Possible Errors

- Any of the [universal error types](/docs/references/http-websocket-apis/api-conventions/error-formatting#universal-errors).
- `invalidParams` - One or more fields are specified incorrectly, or one or more required fields are missing.
- Cannot connect in stand-alone mode - Network-related commands are disabled in stand-alone mode.