A simple WIORP2040 server

Hello, I have a problem connecting to the server. The problem is with the bind() method, which somehow does not work as it should. Could you please help me?

import network
import socket

PASSWORD = 'test123'
HOST = ''
PORT = 80

wlan = network.WLAN_SPI(network.STA_IF)
wlan.connect(SSID, PASSWORD)

while not wlan.isconnected():

print('connected to the network', SSID)
print('IP adress:', wlan.ifconfig()[0])

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((HOST, PORT))

print('The port is', PORT)

while True:
    conn, addr = s.accept()
    print('Pripojenie od', addr)
    request = conn.recv(1024)
    response = 'HTTP/1.1 200 OK\nContent-Type: text/html\n\n'
    response += '<html><body><h1>A simple WIORP2040 server</h1></body></html>'

The goal of this code is to throw out the IP address to which I connect via a web browser.

Current error:

Traceback (most recent call last):
File “”, line 20, in
AttributeError: ‘socket’ object has no attribute ‘bind’