# Stuck on #EJ5. dial tcp 127.0.0.1:4221: connect: connection refused

**URL:** <https://forum.codecrafters.io/t/stuck-on-ej5-dial-tcp-127-0-0-1-connect-connection-refused/14985>\
**Category:** Challenges\
**Tags:** challenge:http-server\
**Created:** [August 17, 2025, 12:21pm UTC](https://forum.codecrafters.io/t/stuck-on-ej5-dial-tcp-127-0-0-1-connect-connection-refused/14985 "2025-08-17T12:21:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![arakitakashi](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/arakitakashi/32/15288_2.png) [@arakitakashi](https://forum.codecrafters.io/u/arakitakashi)\
**Post date:** [August 17, 2025, 12:21pm UTC](https://forum.codecrafters.io/t/stuck-on-ej5-dial-tcp-127-0-0-1-connect-connection-refused/14985/1 "2025-08-17T12:21:27Z")

</div>

I’m stuck on Stage #EJ5

I’ve tried

```auto
codecrafters test

```

Here are my logs:

```auto
[compile] warning: `codecrafters-http-server` (bin "main") generated 4 warnings
[compile] Finished `release` profile [optimized] target(s) in 18.99s
[compile] Moved ./.codecrafters/run.sh → ./your_program.sh
[compile] Compilation successful.

Debug = true

[tester::#EJ5] Running tests for Stage #EJ5 (Concurrent connections)
[tester::#EJ5] Running program
[tester::#EJ5] $ ./your_program.sh
[tester::#EJ5] Creating 2 parallel connections
[tester::#EJ5] Creating connection 1
[your_program] /app/your_program.sh: 11: exec: /tmp/codecrafters-build-http-server-rust/release/codecrafters-http-server: not found
[tester::#EJ5] Hint: 'connection refused' usually means that your server is not running.
[tester::#EJ5] dial tcp 127.0.0.1:4221: connect: connection refused
[tester::#EJ5] Test failed
[tester::#EJ5] Terminating program
[tester::#EJ5] Program terminated successfully

```

---

<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:** [August 17, 2025, 5:03pm UTC](https://forum.codecrafters.io/t/stuck-on-ej5-dial-tcp-127-0-0-1-connect-connection-refused/14985/3 "2025-08-17T17:03:31Z")

</div>

Hey @arakitakashi, since main.rs was moved from `src` to `src/bin`, you’ll need to edit `.codecrafters/run.sh` as well:

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/4/e/4e5b9ec9868cd6334e4fb3ad83da2b5d4c815be0.png)

```auto
exec /tmp/codecrafters-build-http-server-rust/release/main "$@"

```

Let me know if this fixes the issue.

---

<div class="post-metadata">

**Author:** ![arakitakashi](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/arakitakashi/32/15288_2.png) [@arakitakashi](https://forum.codecrafters.io/u/arakitakashi)\
**Post date:** [August 17, 2025, 8:54pm UTC](https://forum.codecrafters.io/t/stuck-on-ej5-dial-tcp-127-0-0-1-connect-connection-refused/14985/4 "2025-08-17T20:54:49Z")

</div>

Thanks! I’m glad the suggested method worked and fixed the issue for you.

---

<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:** [August 22, 2025, 8:55pm UTC](https://forum.codecrafters.io/t/stuck-on-ej5-dial-tcp-127-0-0-1-connect-connection-refused/14985/5 "2025-08-22T20:55:43Z")

</div>

Closed on August 22, 2025, 8:55pm UTC

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