-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(IRC): add WebsocketKit support #17
base: main
Are you sure you want to change the base?
Conversation
This matches better with what we want to accomplish, which is to provide different websocket implementations.
Otherwise the compiler can't tell which method we are trying to call. The interesting part is this is only an issue in Linux...
bedbbe3
to
591e15c
Compare
591e15c
to
e8dda27
Compare
Ah, seems like they fixed swiftlang/swift-corelibs-foundation#4730 so building |
Hey, sorry for the late response, very busy with university so far sadly. You guessed correctly, WebSocketKit für Linux has been a goal and the overall idea of your implementation looks good to me on first glance, it should definitely be an option for platforms where URLSession doesn't work, while the default still stays URLSession. I'll take a closer look at the implementation this evening or tomorrow and get back to you again.
Even when the fix ships, building libcurl from source is imo not the ideal state, so I'd still like WebSocketKit to be an option. |
Yeah, no worries, take as much as you need. If I need to use it I can point to my branch while this is in review 😄 |
Okay, so I've looked at all the changes now and in general the code looks pretty much good to go. But I am not sure if extracting it to a separate target is a big benefit, I think it'd make more sense to just move all of the WebSocketTask/TaskProvider stuff into I do like that the separate target gives you the ability to use WebSocketKit on macOS/iOS/etc. as well, without carrying around the extra dependency if not needed and including it conditionally on Linux only would take that option away, but realistically I don't see a reason why you'd actually need it on Apple platforms. |
Hi there! Hope all is well 😄 I bring goodies!
I wanted to use this to deploy a small app to Docker. Unfortunately, I came across the same issue you had reported in
FoundationNetworking
: swiftlang/swift-corelibs-foundation#4730 (it was kind of amusing realizing both of us arrived at it lol). I even went ahead and compiledlibcurl
from source to enable the websocket support, but it turns out that it still produces errors...So I went ahead and did the next best thing: add support for using WebsocketKit instead of URLSession (I think this may've already been in your plans, since it was a dependency).
I did it in such a way that switching between the two just involves changing a generic parameter, which I thought was neat. I also added the implementation in a different module so it's totally optional.
Some caveats is that I had to change some internal interfaces, and expose some. Let me know if you can come up with something else!
Finally, I have tested it in a simple client application, but I wouldn't say it is battle tested at all, so there's that. Although it's better than nothing, maybe?
Anyways, let me know if this makes sense to you to merge, or about any issues/comments you have about the implementation itself.
Cheers!