Cant connect my esp8266 with websockets on localhost

15:14:21.357 -> ip:192.168.1.4,mask:255.255.255.0,gw:192.168.1.1
15:14:21.357 -> [WS-Client] Websocket Version: 2.3.5
15:14:21.396 -> [WS-Client] connect ws...
15:14:21.623 -> [WS-Client] connected to 192.168.1.12:8001.
15:14:21.623 -> [WS-Client][sendHeader] sending header...
15:14:21.662 -> [WS-Client][sendHeader] handshake GET /socket.io HTTP/1.1
15:14:21.662 -> Host: 192.168.1.12:8001
15:14:21.662 -> Connection: Upgrade
15:14:21.662 -> Upgrade: websocket
15:14:21.662 -> Sec-WebSocket-Version: 13
15:14:21.662 -> Sec-WebSocket-Key:
15:14:21.662 -> Sec-WebSocket-Protocol: arduino
15:14:21.662 -> Origin: file://
15:14:21.662 -> User-Agent: arduino-WebSocket-Client
15:14:21.662 ->
15:14:21.662 -> [write] n: 253 t: 8864
15:14:21.662 -> [WS-Client][sendHeader] sending header... Done (28912us).
15:14:22.953 -> [WS-Client] connection lost.
15:14:22.953 -> [WS-Client] client disconnected.

Welcome to the forum

Your post was MOVED to its current location as it is more suitable

HINT : Do you think it might help if you posted your sketch ?

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination