---
title: "bindToAnyPort"
sidebar_label: "bindToAnyPort"
description: "Kotlin binding reference: bindToAnyPort."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../index.md)/[io.clika.runtime](../index.md)/[HttpServer](index.md)/[bindToAnyPort](bindToAnyPort.md)

# bindToAnyPort

[common]\
fun [bindToAnyPort](bindToAnyPort.md)(host: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)

Serve on [host](bindToAnyPort.md) at a port the system picks, on a background thread; the port is answered.