Skip to content
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

Linux support (WebSocket client) #346

Open
pixelspark opened this issue Jun 13, 2017 · 19 comments
Open

Linux support (WebSocket client) #346

pixelspark opened this issue Jun 13, 2017 · 19 comments

Comments

@pixelspark
Copy link

Would really like to have Starscream on Linux as WebSocket client (a WebSocket server is already available through Kitura-WebSocket but a WebSocket client is currently missing, and the server WG has not yet produced anything usable at this point as far as I know).

Would it be feasible to switch over to a generic socket library (such as https://github.com/IBM-Swift/BlueSocket ? I believe there is also SSL support in there for both macOS and Linux).

#285 discussed Linux support before, but that concerned a WebSocket server.

@daltoniam
Copy link
Owner

I would like to see Linux support too 😄. I think it might be feasible, I know in #335 there has been talk of allowing a swap out of different socket connections/adapters which would probably be the most flexible route. It is probably worth looking at with the Xcode 9 and Swift 4 update that will be need here in the near future.

@daltoniam
Copy link
Owner

I did some work with the 3.0.0 release to allow this. There is a new WSStream class that can be implemented to allow a custom socket to be used. I also add some os checks for linux around the security framework since that doesn't exist on non apple platforms. I haven't done a full linux test yet, but I'm hopeful it should be feasible now.

@pixelspark
Copy link
Author

@daltoniam cool stuff! Will have a look at it later on. How is/will security processing (e.g. the hashing required to establish a connection) (be) done on Linux? I suppose you need to use CommonCrypto on OSX/iOS and openssl on Linux (perhaps just use a wrapper library such as IBM-Swift/Cryptor, which has worked well for me)?

@acmacalister
Copy link
Collaborator

@pixelspark, yeah that is what we are probably looking at. We haven't heard or seen any signs of the Security.framework making it's way over to Linux, so a wrapper around OpenSSL is probably going to be our best bet. As far as the sha1 hashing is concerned, we could use the OpenSSL version or implement our own in pure Swift like CryptoSwift does. For the certificate/trust validation, I think OpenSSL is going to be the only way. Good catch on sha1 hashing still using CC. Should be fairly easy to move that out of the WSStream class and make something flexible for all the platforms.

@caiofbpa
Copy link

caiofbpa commented Jan 17, 2018

Any way I can help this move forward? I got IBM-Swift/BlueCryptor included in Starscream locally, but I couldn't manage to run Autobahn|Testsuite to check if it's all good...

@wbarksdale
Copy link

@caiofbpa I would be interested in testing out this branch!

@caiofbpa
Copy link

@wbarksdale I've opened a PR with that branch on #454. Can you help me test and review it?

@c-bata
Copy link

c-bata commented Jun 18, 2018

Hi. Is there any update on this?

@xylobol
Copy link

xylobol commented Jul 23, 2018

Anything new?

@fassko
Copy link
Collaborator

fassko commented Sep 27, 2018

I think this should be solved with SwiftNIO. I have plan to integrate that into Starscream at some point. #484

@nerzh
Copy link

nerzh commented Nov 7, 2018

@fassko if to use "Swift-NIO", then I think this library is no longer needed :D

@fassko
Copy link
Collaborator

fassko commented Nov 7, 2018

It won't because SwiftNIO needs Network.framework which is only for iOS 12+, tvOS 12+, macOS 10.14+ and exclude watchOS.

@alex-taffe
Copy link

Any updates on this?

@fassko
Copy link
Collaborator

fassko commented Jun 30, 2020

Not really, maybe you can help out?

@alex-taffe
Copy link

@fassko do you know if any effort has been on this so far and if so, can you point me in the right direction?

@nerzh
Copy link

nerzh commented Jun 30, 2020

@alex-taffe but why do you need it on Linux ?

@alex-taffe
Copy link

alex-taffe commented Jun 30, 2020

@nerzh Attempting to build a cross platform socket based framework, could do it in another language but prefer the type safety of Swift and ease of integration in iOS apps. I just saw your comment about swift-nio though, which also looks extremely promising

@fassko
Copy link
Collaborator

fassko commented Jun 30, 2020

@alex-taffe it should work by default, but I don't have Linux box to test on myself.

@alex-taffe
Copy link

Ok I’ll do some testing, thanks. Looks like Vapor also may be an option but more complicated than I really need

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants