> For the complete documentation index, see [llms.txt](https://doc.ankabot.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.ankabot.dev/mode-controleur/methodes/ankabotcontroller/assignproxytoanaccount.md).

# assignProxyToAnAccount

Méthode permettant d'assigner un proxy à un compte.

### 🎮 Méthode

```coffeescript
ankabotController:assignProxyToAnAccount(username, ip, port, proxyUsername, proxyPassword, https, enabled)
```

### 📝 Arguments

| Nom           | Type   | Description                    |             |                  |
| ------------- | ------ | ------------------------------ | ----------- | ---------------- |
| username      | string | Nom du compte.                 | Obligatoire |                  |
| ip            | string | Adresse IP du proxy.           | Obligatoire |                  |
| port          | int    | Port d'accès au proxy.         | Obligatoire |                  |
| proxyUsername | string | Utilisateur du proxy.          | Facultatif  |                  |
| proxyPassword | string | Mot de passe du proxy.         | Facultatif  |                  |
| https         | bool   | True = https \| false = Socks5 | Facultatif  | false par défaut |
| enabled       | bool   | Activé ou non.                 | Facultatif  | true par défaut  |

### 💎 Valeur de retour

| Type | Description |
| ---- | ----------- |

### Exemple

Proxy accessible via un username et un password :

```coffeescript
username      = "username1"
ip            = "0.0.0.0"
port          = 8080
proxyUsername = "proxyN1"
proxyPassword = "proxyP1"

ankabotController:assignProxyToAnAccount(username, ip, port, proxyUsername, proxyPassword)
```

Proxy accessible sans username et sans password :

```coffeescript
username = "username1"
ip       = "0.0.0.0"
port     = 8080

ankabotController:assignProxyToAnAccount(username, ip, port)
```

Désactiver le proxy :

```coffeescript
username = "username1"
ankabotController:assignProxyToAnAccount(username, "", 0, "", "", false, false)
```
