I’m fairly new to Xcode and swift. I’m building my first application. It’s a simple chat box GUI in swift that I want to use my python back end program to be able to send and receive requests. My python program is using the Fast API framework and I’ve set the port to 8080 in my swift GUI on the front end. when I try building my application in Xcode the build is successful but if I try to hit the send button in the simulator I get this error and I’ve tried everything to fix it.
2023-03-12 21:55:14.750406-0400 Mac GPT[75198:3546121] [connection] nw_socket_handle_socket_event [C1:2] Socket SO_ERROR [61: Connection refused] 2023-03-12 21:55:14.751307-0400 Mac GPT[75198:3546121] Connection 1: received failure notification 2023-03-12 21:55:14.751389-0400 Mac GPT[75198:3546121] Connection 1: failed to connect 1:61, reason -1 2023-03-12 21:55:14.751419-0400 Mac GPT[75198:3546121] Connection 1: encountered error(1:61) 2023-03-12 21:55:14.751550-0400 Mac GPT[75198:3546121] [connection] nw_connection_copy_connected_local_endpoint_block_invoke [C1] Client called nw_connection_copy_connected_local_endpoint on unconnected nw_connection 2023-03-12 21:55:14.751577-0400 Mac GPT[75198:3546121] [connection] nw_connection_copy_connected_remote_endpoint_block_invoke [C1] Client called nw_connection_copy_connected_remote_endpoint on unconnected nw_connection 2023-03-12 21:55:14.752257-0400 Mac GPT[75198:3546121] Task <0C6550E8-6F1C-42FD-9C78-2E25AF2DD4F9>.<1> HTTP load failed, 0/0 bytes (error code: -1004 [1:61]) 2023-03-12 21:55:14.757622-0400 Mac GPT[75198:3546668] Task <0C6550E8-6F1C-42FD-9C78-2E25AF2DD4F9>.<1> finished with error [-1004] Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=61, NSUnderlyingError=0x600003a23a80 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_NSURLErrorNWPathKey=satisfied (Path is satisfied), viable, interface: lo0, dns, _kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <0C6550E8-6F1C-42FD-9C78-2E25AF2DD4F9>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalDataTask <0C6550E8-6F1C-42FD-9C78-2E25AF2DD4F9>.<1>" ), NSLocalizedDescription=Could not connect to the server., NSErrorFailingURLStringKey=http://192.168.1.155:8080/MacGPT, NSErrorFailingURLKey=http://192.168.1.155:8080/MacGPT, _kCFStreamErrorDomainKey=1} Error:Error Domain=NSURLErrorDomain Code=-1004 "Could not connect to the server." UserInfo={_kCFStreamErrorCodeKey=61, NSUnderlyingError=0x600003a23a80 {Error Domain=kCFErrorDomainCFNetwork Code=-1004 "(null)" UserInfo={_NSURLErrorNWPathKey=satisfied (Path is satisfied), viable, interface: lo0, dns, _kCFStreamErrorCodeKey=61, _kCFStreamErrorDomainKey=1}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <0C6550E8-6F1C-42FD-9C78-2E25AF2DD4F9>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalDataTask <0C6550E8-6F1C-42FD-9C78-2E25AF2DD4F9>.<1>" ), NSLocalizedDescription=Could not connect to the server., NSErrorFailingURLStringKey=http://192.168.1.155:8080/MacGPT, NSErrorFailingURLKey=http://192.168.1.155:8080/MacGPT, _kCFStreamErrorDomainKey=1}
if it helps I can also show my swift code thanks for the help.