In MITM mode, short for man-in-the-middle, you play Dofus as usual and a bot sits between your game and Ankama's servers, passing everything along in both directions. The bot sees the whole session and can run packages, and Asterobot never needs your Ankama login. Your first bot walks through a first setup.
Caution
A bot in MITM mode is still a bot. Using bots breaks Ankama's terms of use, and Ankama can sanction the accounts involved. Read Accounts and safety first.
When to use it
- To follow or extend the game you're playing: read your chat and inventory, watch the messages, run a package alongside you.
- For accounts protected by Ankama Shield or two-factor authentication, which Full socket mode doesn't support.
- When you don't have a connection script. Your game already identified itself, so the bot is in the game as soon as the session reaches it. A script started on a relayed session is told it's resuming, which makes a connection script skip its identification step. See Identify and run.
It isn't made for bots that play without you: every relayed session starts with someone launching Dofus and signing in.
What you need
- Dofus 3 installed with the Ankama Launcher, on the computer where Asterobot runs. For a Dofus on another computer, see MITM across machines.
- The same Dofus version in Game Manager, downloaded and extracted. See Download a game version.
- A bot using that version, with or without an Ankama account. See Add a bot.
- Asterobot signed in to asterobot.net.
server.tlsoff andserver.basicAuthempty, which are their defaults.
Warning
MITM mode doesn't work while server.tls is on or server.basicAuth is set, even with Dofus and Asterobot on the same computer. Dofus fetches its connection settings from Asterobot, at the address in the ConfigUrl line described below. That address always starts with http://: with server.tls on, Asterobot only answers over HTTPS, so the request fails. With server.basicAuth set, Asterobot asks for a login and password that Dofus never sends. Either way, the bot starts waiting as usual, then stays Waiting for your game client while you play. Put both settings back to their defaults on Server > Config and restart Asterobot. Settings reference describes both settings, and MITM across machines covers setups where other devices need to reach Asterobot.
The same version
The Dofus you play states its version on the Version= line of Dofus_Data/StreamingAssets/version, in its folder. When a bot starts waiting, Asterobot compares that number with the version of its own copy and refuses when they differ. Only the version number counts, so a Linux or macOS client of the same version is fine.
When your bots use different game versions, Asterobot may compare your game with any of them, not necessarily the bot that's waiting. Keep all your bots on the version you play while you use MITM mode. After an Ankama patch, follow When Dofus updates.
Start waiting
- Open the bot's page and click Start waiting. It's also in the bot's menu in Bot Manager, and Wait for my game client does it right after adding a bot.
- The status turns to Waiting for your game client, and the bot's console shows
Waiting for a game client. The bot can stay like this as long as you want. - Start Dofus from the Ankama Launcher and sign in. If Dofus was already open, close it and start it again.
When your session reaches the bot, the status turns to Connected to game server. The console shows Attached to Ankama account the first time, then A client is being sent to us and Relaying a game session. Your game plays exactly as usual.
Nothing starts playing by itself: to run a package on the relayed session, press Play. See Run a package.
When the bot can't start waiting
Asteroboard shows Couldn't put the bot into waiting and the bot stays Disconnected. It doesn't say why, so go through the causes:
| Cause | What to check |
|---|---|
| The Dofus you play isn't the version in Game Manager | Compare the Version= line of your version file with Game Manager, and download the version you play. |
Asterobot can't read the version file |
botmanager.mitmGamePath must be the Dofus folder itself, the one that contains Dofus_Data. |
The version file has no ConfigUrl line |
The file isn't a normal Dofus version file. Check the folder in botmanager.mitmGamePath. |
The ConfigUrl line still points at Asterobot from an earlier run, and Asterobot's copy of the game has no version file to read the original from |
Put the original line back by hand, as MITM problems describes, or click Download more files on the bot's game version with the default filter. |
| Another program uses port 5555 or 5556 | Close that program, or change botmanager.mitmSignInPort and botmanager.mitmSessionPort, then restart Asterobot. |
| Both port settings have the same value | Give them two different ports, then restart Asterobot. |
MITM problems goes through each case.
The line Asterobot changes in your Dofus folder
To send your game through Asterobot, Asterobot edits one line of one file: Dofus_Data/StreamingAssets/version, in your Dofus folder. That file's ConfigUrl line tells Dofus where to fetch its connection settings. When the first bot starts waiting, Asterobot remembers the original line and replaces it. With the default settings, it becomes:
ConfigUrl=http://127.0.0.1:8080/botmanager/mitm/dofus3.json
The address in it is botmanager.mitmAdvertiseHost, or botmanager.mitmBindHost when that one is empty, and the port is the one in server.listenAddress. The rest of the file isn't touched.
When Dofus fetches that address, Asterobot answers with Ankama's real connection settings, changed in one place: the sign-in server is Asterobot's port 5555. Your game signs in through Asterobot, and Asterobot forwards everything to Ankama. Its log, in the terminal and on Server > Console, shows Pointed the played game at Asterobot when it edits the line.
Asterobot puts the original line back:
- when no bot is waiting any more, because you disconnected or deleted the last one;
- when Asterobot stops normally, with Ctrl+C or Shutdown server;
- the next time Asterobot starts, if it was stopped abruptly and couldn't do it then. The log shows
Restored a game install left pointing at Asterobot by a previous run. Asterobot reads the original line from its own copy of the game, which it finds through a bot that came back as it started, so this needs at least one bot restored at start andbotmanager.mitmGamePathset. Otherwise, put the line back by hand.
The first two print Pointed the played game back at Ankama. If a bot starts waiting and finds the line still pointing at Asterobot from an earlier run, Asterobot reads the original address from its own copy of the game and fixes it first, printing Recovering a ConfigUrl left pointing at Asterobot by a previous run.
While the line points at Asterobot, a game signed in with an account no bot is waiting for passes through untouched and plays normally. When Asterobot isn't running at all, though, Dofus can't sign in. Start Asterobot again: it puts the line back as it starts, as long as one of your bots comes back with it. If it doesn't, see Dofus can't sign in.
Where Asterobot looks for your Dofus folder
The folder is the botmanager.mitmGamePath setting, on Server > Config. Its default is the Ankama Launcher's usual folder:
| System | Default |
|---|---|
| Windows | %AppData%\Ankama\Dofus-dofus3 |
| Linux | ~/.config/Ankama/Dofus-dofus3, or the same folder under XDG_CONFIG_HOME when that's set |
| macOS | None |
The default is only filled in when that folder exists as Asterobot starts. If you installed Dofus after starting Asterobot, restart Asterobot, or set the folder yourself.
On macOS, and whenever your Dofus is somewhere else, set botmanager.mitmGamePath to the folder that contains Dofus_Data/StreamingAssets/version. The setting applies without restarting, from the moment no bot is waiting: disconnect every waiting bot, change it, then click Start waiting again.
Warning
When botmanager.mitmGamePath is empty, a bot still starts waiting, but nothing is edited and your game never reaches it. If the log doesn't show Pointed the played game at Asterobot after a bot starts waiting, check this setting first.
Which bot gets which game session
Every game that signs in through Asterobot is matched with a waiting bot by the Ankama account it signed in with:
- A waiting bot already attached to that account gets the session.
- Otherwise, the first waiting bot that isn't attached to any account, in alphabetical order of names, takes it and attaches itself to that account.
- Otherwise, no bot takes it. The game goes straight to Ankama and plays normally, and Asterobot's log shows
A game client signed in that no bot is waiting for.
How long an attachment lasts depends on the bot:
- A bot without an Ankama account stays attached for good. The attachment is saved, so after a restart the bot still only takes that account's sessions. Asteroboard doesn't show the attached account until a session arrives, on the bot's Information tab, and it has no way to detach a bot. To relay another account, add another bot.
- A bot with an Ankama account attaches the same way, to whichever account signs in first, even if that isn't the account stored for it. That attachment isn't saved: it lasts until Asterobot restarts, or until you change the bot's account or game version.
If a new session arrives for an account whose bot is already relaying one, it replaces the session the bot was carrying. Many bots shows how to set up several clients.
When you quit Dofus
The relayed session ends: the console shows Game connection lost and the status goes back to Waiting for your game client. A script that was running stops, with The behavior stopped with an error on the bot's page. The bot keeps waiting for your next session, and the line in your Dofus folder stays pointed at Asterobot.
Next time you play, start Dofus and sign in: the bot takes the session again. Press Play if you want its package running.
To stop for good, click Disconnect. The bot stops waiting and, if it was the last one, Asterobot puts the original line back. If you're in game at that moment, your game is disconnected, because the bot was carrying its session. The same happens when you delete the bot or stop Asterobot.
A bot waiting for your game client or relaying it can't also sign in on its own: disconnect it first to use Full socket mode.
Ports and settings
All of these are on Server > Config.
| Setting | Default | What it does | Restart needed |
|---|---|---|---|
botmanager.mitmSignInPort |
5555 |
Port your Dofus signs in on. | Yes |
botmanager.mitmSessionPort |
5556 |
Port your Dofus opens its game session on, after signing in. One port serves every bot: Asterobot tells sessions apart by what they send. | Yes |
botmanager.mitmBindHost |
127.0.0.1 |
Network interface the two ports listen on. 127.0.0.1 only accepts connections from this computer. |
Yes |
botmanager.mitmAdvertiseHost |
Empty | Address your Dofus is told to connect to. Empty uses botmanager.mitmBindHost, or 127.0.0.1 when that's 0.0.0.0. |
Yes |
botmanager.mitmGamePath |
See above | The Dofus folder whose version file is read and edited. Nothing else is read from it: game data always comes from Asterobot's own copy. |
No |
server.tls and server.basicAuth aren't MITM settings, but both have to stay at their defaults for MITM mode to work, as the warning under What you need explains.
The two ports only open while at least one bot is waiting, and close once none is. When they open, Asterobot's log shows Ready for game clients with the addresses in use, including the ConfigUrl value a Dofus on another computer needs.
Relaying a Dofus that runs on another computer means changing botmanager.mitmBindHost, and editing the ConfigUrl line on that computer yourself, since Asterobot can only edit files on its own. MITM across machines explains the whole setup, and Security what opening the ports means.
Where to go next
- Run a package on your relayed session.
- Network traffic, to watch your game's messages.
- Many bots, to relay several Dofus clients.