# Failed to create connection: dial tcp \[::1\]:4221: connect: connection refused

**URL:** https://forum.codecrafters.io/t/failed-to-create-connection-dial-tcp-1-connect-connection-refused/1000
**Category:** Challenges
**Tags:** challenge:http-server
**Created:** [July 11, 2024, 9:37pm UTC](https://forum.codecrafters.io/t/failed-to-create-connection-dial-tcp-1-connect-connection-refused/1000 "2024-07-11T21:37:14Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![yossev](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/yossev/32/923_2.png) [@yossev](https://forum.codecrafters.io/u/yossev)
#### Post date: [July 11, 2024, 9:37pm UTC](https://forum.codecrafters.io/t/failed-to-create-connection-dial-tcp-1-connect-connection-refused/1000/1 "2024-07-11T21:37:15Z")

</div>

I’m stuck on Stage #IH0

I’ve tried … resetting the whole thing.

Here are my logs:

```auto
[compile] Compilation successful.

[tester::#IH0] Running tests for Stage #IH0 (Extract URL path)
[tester::#IH0] Running program
[tester::#IH0] $ ./your_server.sh
[your_program] Logs from your program will appear here!
[tester::#IH0] Failed to create connection: dial tcp [::1]:4221: connect: connection refused
[tester::#IH0] Test failed
[tester::#IH0] Terminating program
[tester::#IH0] Program terminated successfully

```

---

<div class="post-metadata">

### Author: ![igor-artico](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/igor-artico/32/1072_2.png) [@igor-artico](https://forum.codecrafters.io/u/igor-artico)
#### Post date: [July 25, 2024, 3:55am UTC](https://forum.codecrafters.io/t/failed-to-create-connection-dial-tcp-1-connect-connection-refused/1000/3 "2024-07-25T03:55:44Z")

</div>

Hey man, hope you’re doing fine !

I’ve had a similar problem on another project and I was using goroutines (“go doSomething()”) without understanding it and knowing that a new thread is created, which I guess was “hiding” the connection port ? So maybe verify your function calls, hope that helps !

---

<div class="post-metadata">

### Author: ![rohitpaulk](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/rohitpaulk/32/6_2.png) [@rohitpaulk](https://forum.codecrafters.io/u/rohitpaulk)
#### Post date: [July 29, 2024, 6:52pm UTC](https://forum.codecrafters.io/t/failed-to-create-connection-dial-tcp-1-connect-connection-refused/1000/4 "2024-07-29T18:52:28Z")

</div>

@yossev could you share a snippet of your code? Hard to help without more information.

---

<div class="post-metadata">

### Author: ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)
#### Post date: [October 4, 2024, 2:57am UTC](https://forum.codecrafters.io/t/failed-to-create-connection-dial-tcp-1-connect-connection-refused/1000/5 "2024-10-04T02:57:49Z")

</div>

Closing this thread due to inactivity. If you still need assistance, feel free to start a new discussion!

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/7/0/700657133935c15703e22c7c8870394f6e6dc27d.svg) [@system](https://forum.codecrafters.io/u/system)
#### Post date: [October 9, 2024, 2:58am UTC](https://forum.codecrafters.io/t/failed-to-create-connection-dial-tcp-1-connect-connection-refused/1000/6 "2024-10-09T02:58:35Z")

</div>

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.
