Last week I've been checking bidirectional examples with latest Xcode 16 beta 3 and realised it uses HBv2, which is supported only by macOS 14+, and it's not perfect. After downgrading to HBv1—same problem with returning stream until some bytes are sent appeared. Haven't figured out yet why, maybe some tech inside uses URLSession. So, this PR fixes two things:
Moved server to Vapor for two reasons: 1) anyway can't use HBv2 now and 2) it could be more familiar to others;
Moved back to URLSession for client and added initial message hack.
It's working for now. I'll be checking from time to time status of Swift Server tools, maybe we can improve it in the future.
Last week I've been checking bidirectional examples with latest Xcode 16 beta 3 and realised it uses HBv2, which is supported only by macOS 14+, and it's not perfect. After downgrading to HBv1—same problem with returning stream until some bytes are sent appeared. Haven't figured out yet why, maybe some tech inside uses URLSession. So, this PR fixes two things:
initial message
hack.It's working for now. I'll be checking from time to time status of Swift Server tools, maybe we can improve it in the future.