# Bug: Keep Alive connections shared when ports are different

**URL:** <https://community.postman.com/t/bug-keep-alive-connections-shared-when-ports-are-different/11131>\
**Category:** Help Hub\
**Created:** [March 2, 2020, 8:04pm UTC](https://community.postman.com/t/bug-keep-alive-connections-shared-when-ports-are-different/11131 "2020-03-02T20:04:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris.branch](https://avatars.discourse-cdn.com/v4/letter/c/4da419/32.png) [@chris.branch](https://community.postman.com/u/chris.branch)\
**Post date:** [March 2, 2020, 8:04pm UTC](https://community.postman.com/t/bug-keep-alive-connections-shared-when-ports-are-different/11131/1 "2020-03-02T20:04:44Z")

</div>

Postman 7.19.1 (Mac OS) appears to have a bug related to Keep Alive connections that share the same domain name, but different ports. Example:

[http://localhost:8000/public](http://localhost:8000/public)  
[http://localhost:8001/admin](http://localhost:8001/admin)

When I send a GET request to one of these endpoints via Postman, everything works fine. However, when I try to interleave GET requests to both endpoints, I receive a successful response from whichever one I hit first, and a 404 from the other. If I wait 75 seconds, then I can successfully hit the second endpoint (but the the first endpoint returns 404 until I wait another 75 seconds). If I add a “Connection: close” header to both requests, then the problem does not occur – I can interleave calls without waiting 75 seconds. Also, if I use curl to run the same requests (generated by Postman), the problem does not occur.

I also noticed that the request that Postman sends to localhost:8001 that returns the 404 response shows up in my server logs as localhost:8000 even though it says localhost:8001 in the Postman console.

Conclusion: I suspect that Postman is maintaining a connection pool for keep alive connections and incorrectly reusing connections for the same host but different ports. It should match both host and port before allowing connection reuse.

---

<div class="post-metadata">

**Author:** ![kevin.swiber](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/kevin.swiber/32/3820_2.png) [@kevin.swiber](https://community.postman.com/u/kevin.swiber)\
**Post date:** [March 3, 2020, 1:35am UTC](https://community.postman.com/t/bug-keep-alive-connections-shared-when-ports-are-different/11131/2 "2020-03-03T01:35:34Z")

</div>

Hi, @chris.branch! This certainly sounds like a bug. Would you mind reporting it here so our Engineering team can have a look? [https://github.com/postmanlabs/postman-app-support/issues](https://github.com/postmanlabs/postman-app-support/issues)

Thanks!

---

<div class="post-metadata">

**Author:** ![chris.branch](https://avatars.discourse-cdn.com/v4/letter/c/4da419/32.png) [@chris.branch](https://community.postman.com/u/chris.branch)\
**Post date:** [March 3, 2020, 5:16pm UTC](https://community.postman.com/t/bug-keep-alive-connections-shared-when-ports-are-different/11131/3 "2020-03-03T17:16:38Z")

</div>

Done:

> <https://github.com/postmanlabs/postman-app-support/issues/8134>
>
> \*\*Describe the bug\*\*
> Postman 7.19.1 (Mac OS) appears to have a bug related to K…eep Alive connections that share the same domain name, but different ports. Example:
> 
> http://localhost:8000/public
> http://localhost:8001/admin
> 
> When I send a GET request to one of these endpoints via Postman, everything works fine. However, when I try to interleave GET requests to both endpoints, I receive a successful response from whichever one I hit first, and a 404 from the other. If I wait 75 seconds, then I can successfully hit the second endpoint (but then the first endpoint returns 404 until I wait another 75 seconds). If I add a “Connection: close” header to both requests, then the problem does not occur – I can interleave calls without waiting 75 seconds. Also, if I use curl to run the same requests (generated by Postman), the problem does not occur.
> 
> I also noticed that the request that Postman sends to localhost:8001 that returns the 404 response shows up in my server logs as localhost:8000 even though it says localhost:8001 in the Postman console.
> 
> Conclusion: I suspect that Postman is maintaining a connection pool for keep alive connections and incorrectly reusing connections for the same host but different ports. It should match both host and port before allowing connection reuse.
> 
> \*\*To Reproduce\*\*
> Steps to reproduce the behavior:
> 1. GET http://localhost:8000/public (response = 200)
> 2. GET http://localhost:8001/admin (response = 404)
> 3. ...wait at least 75 seconds...
> 4. GET http://localhost:8001/admin (response = 200)
> 5. GET http://localhost:8000/public (response = 404)
> 
> \*\*Expected behavior\*\*
> Expected a 200 response consistently from both requests, independent of the order requests are executed and/or idle time in between requests.
> 
> \*\*App information (please complete the following information):\*\*
> - App Type: Native App
> - Postman Version: 7.19.1
> - OS: macOS Mojave 10.14.6
> 
> \*\*Additional context\*\*
> n/a
