---
redirect_from: "/Remote-Access"
---
# Remote Access
## Introduction
Azerothcore has 4 ways of interfacing with the world server.
- In Game
- The Console
- Telnet (RA)
- HTTP (SOAP)
The in game menus and the console are pretty self explanatory, however you are not always able to administer the server locally nor do the first two options provide many opportunities for automation. If you want to provide a way to access your server remotely, or let software manage it then you have two options.
## Choosing the Correct Protocol
### Remote Access
Remote access is basically a telnet connection and has all of the downsides a telnet connection brings. These would be:
- Data is sent over cleartext which can be intercepted easily.
- You use distinct sessions, meaning you open and close a connection each time.
- It can be difficult to parse the return since it just returns what you would see in the CLI
However, it has upsides as well, namely:
- It is simple with little overhead.
- It is well established and documented.
- Platform independent.
Remote access is good for running on a local server, and accessing it securely over SSH to send it commands. Its simplicity is its strength. On top of that it is built in to most machines without any configuration needed.
### SOAP
It stands for simple object access protocol and is a format for sharing structured data between machines. It is a common xml analogue to ReST and json, and lets two pieces of software interact with each other despite running on different code bases, languages, and operating systems. Lets get on to the weaknesses.
- No default encoding meaning that you can get away with almost anything. Some people may see it as a bonus but it can be confusing.
- Little security
And its strengths.
- XML is a well established format supported in most programming languages.
- Uses standard HTTP
In a more simplified format: SOAP for websites, telnet for command line.
## Using the Protocol of Choice
### Setup
1. Both protocols must be enabled via the [worldserver config files](https://github.com/azerothcore/azerothcore-wotlk/blob/master/src/server/apps/worldserver/worldserver.conf.dist#L3122).
2. When they are enabled, in order to authorize access to the database, you need to find the `account_access` table in the auth database and make sure the realmID of your user is -1 (meaning all realms).
3. When that is done you are set up to use telnet and SOAP
### Access
#### Telnet
Due to it's ubiquity telnet is easy to use from almost anywhere.
1. open up a terminal session (or PuTTY) and type in `telnet localhost 3443`
2. Enter your username and password.
#### Soap
Soap works using standard HTTP POST. The entire post payload is XML.
```xml
server status
```
The response will look like this:
```xml
AzerothCore rev. 6f4f0043c2ab+ 2021-05-18 02:16:59 +0200 (master branch) (Win64, RelWithDebInfo)
Connected players: 0. Characters in world: 0.
Connection peak: 0.
Server uptime: 5 second(s).
Update time diff: 10ms, average: 10ms.
```
Error response looks like this
```xml
SOAP-ENV:Client
Error 401: HTTP 401 Unauthorized
```
You need to authenticate by putting the username and password in the URI like this: `http://soapuser:abcd1234@localhost:7878/` (this is also known as "basic auth")
setting request header `Content-Type: application/xml` is not needed. For now.
## Code Examples
PHP
using built-in [SoapClient](https://www.php.net/manual/en/class.soapclient.php)
```php
$conn = new SoapClient(NULL, array(
'location' => "http://{{ ip }}:{{ port }}/",
'uri' => 'urn:AC',
'style' => SOAP_RPC,
'login' => 'soapuser',
'password' => 'abcd1234'
));
echo $conn->executeCommand(new SoapParam('server info', 'command'));
```
NodeJS (TypeScript)
using [xml2js](https://www.npmjs.com/package/xml2js) to parse the response. Please make sure to sanitize the inputs.
```typescript
function AzerothCore_Soap(command){
return new Promise((resolve, reject)=>{
const req = http.request({
port: 7878,
method: "POST",
hostname: "localhost",
auth: "soapuser:abcd1234",
headers: { 'Content-Type': 'application/xml' }
}, res=>{
res.on('data', async d => {
const xml = await xml2js.parseStringPromise(d.toString());
const body = xml["SOAP-ENV:Envelope"]["SOAP-ENV:Body"][0];
const fault = body["SOAP-ENV:Fault"];
if(fault){
resolve({
faultCode : fault[0]["faultcode"][0],
faultString: fault[0]["faultstring"][0],
});
return;
}
const response = body["ns1:executeCommandResponse"];
if(response){
resolve({
result: response[0]["result"][0]
});
return;
}
console.log(d.toString());
})
});
req.write(
'' +
'' +
'' +
''+command+'' +
'' +
'' +
''
);
req.end();
});
}
```