# setWebhook - docs

docs / com.github.insanusmokrassar.TelegramBotAPI.utils.extensions / com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor / setWebhook

# setWebhook

(jvm) `suspend fun RequestsExecutor.setWebhook(url: String, port: Int, engineFactory: ApplicationEngineFactory<*, *>, listenHost: String = "0.0.0.0", listenRoute: String = "/", certificate: InputFile? = null, privateKeyConfig: WebhookPrivateKeyConfig? = null, scope: CoroutineScope = CoroutineScope(Executors.newFixedThreadPool(4).asCoroutineDispatcher()), allowedUpdates: List<String>? = null, maxAllowedConnections: Int? = null, exceptionsHandler: (suspend (Exception) -> Unit)? = null, block: UpdateReceiver<Update>): Job` (source)

Reverse proxy webhook.

### Parameters

`url` - URL of webhook WITHOUT including of port

`port` - port which will be listen by bot

`listenRoute` - address to listen by bot

`certificate` - com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.MultipartFile or com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId which will be used by telegram to send encrypted messages

`scope` - Scope which will be used for

(jvm) `suspend fun RequestsExecutor.setWebhook(url: String, port: Int, engineFactory: ApplicationEngineFactory<*, *>, listenHost: String = "0.0.0.0", listenRoute: String = "/", certificate: InputFile? = null, privateKeyConfig: WebhookPrivateKeyConfig? = null, scope: CoroutineScope = CoroutineScope(Executors.newFixedThreadPool(4).asCoroutineDispatcher()), allowedUpdates: List<String>? = null, maxAllowedConnections: Int? = null, block: UpdateReceiver<Update>): Job` (source)
`suspend fun RequestsExecutor.setWebhook(url: String, port: Int, engineFactory: ApplicationEngineFactory<*, *>, certificate: InputFile? = null, privateKeyConfig: WebhookPrivateKeyConfig? = null, scope: CoroutineScope = CoroutineScope(Executors.newFixedThreadPool(4).asCoroutineDispatcher()), allowedUpdates: List<String>? = null, maxAllowedConnections: Int? = null, block: UpdateReceiver<Update>): Job` (source)
`suspend fun RequestsExecutor.setWebhook(url: String, port: Int, filter: UpdatesFilter, engineFactory: ApplicationEngineFactory<*, *>, certificate: InputFile? = null, privateKeyConfig: WebhookPrivateKeyConfig? = null, scope: CoroutineScope = CoroutineScope(Executors.newFixedThreadPool(4).asCoroutineDispatcher()), maxAllowedConnections: Int? = null, listenHost: String = certificate ?.let { "0.0.0.0" } ?: "localhost", listenRoute: String = "/"): Job` (source)