Kitura / Kitura-WebSocket

WebSocket support for Kitura
Apache License 2.0
68 stars 29 forks source link

Use as a websocket client #21

Open pixelspark opened 6 years ago

pixelspark commented 6 years ago

As there are currently no real websocket clients out there that work on Linux, extending Kitura-Websocket to be a client would be very helpful. Looks like adding client-side capability would not be too difficult as much of the parts are already in place.

bduisenov commented 6 years ago

Hi @shmuelk, any thoughts on this?

shmuelk commented 6 years ago

I agree that most of the needed code is already inside Kitura-WebSocket.

If you are looking to me to implement it, unfortunately the rest of the IBM Research team that worked on Kitura is now working on other projects. Teams like us, often start things in IBM and then they get passed on to development teams. As has happened with Kitura's "transfer" to the good hands of the Swift @ IBM team.

bduisenov commented 6 years ago

@shmuelk thanks for your answer. Does it mean that Kitura is not in active development anymore?

shmuelk commented 6 years ago

Kitura is actively being developed. The features added lately, such as codeable routing, have all come from the Swift @ IBM team. IBM Research was last involved in Kitura 1.7.0. Kitura 2.x.y was all done by Swift @ IBM.

ianpartridge commented 6 years ago

Hi @bduisenov - we have recently started looking at implementing client-side WebSockets in Swift. We're at an early stage though so I can't say when we might have something you could use. But just to let you know, it is something we're investigating.

sglushchenko commented 5 years ago

I would like to have this feature too. I tried to use BlueSocket, but I faced with the problem when you try to send something to wss://url:443 , I have an error as I try to send plain text to a secure port. So maybe need just correct setup, but I haven't found a solution.

ianpartridge commented 5 years ago

I'm afraid other priorities took over and we haven't made any progress on this. But it's still something that we'd like to see.

sglushchenko commented 5 years ago

@ianpartridge Thanks. Maybe if you will have time can you look BlueSocket why I can set socket that needs to use HTTPS and doesn't send Plain Text :)? I think it should be automatic if we use HTTPS.

And I'm waiting for a lot of new features :)

ianpartridge commented 5 years ago

Are you using https://github.com/IBM-Swift/BlueSSLService ? This is needed for HTTPS.

sglushchenko commented 5 years ago

@ianpartridge No, I haven't used it. But what certificates I should set if I connect to third-party WebSocket? We don't set any certificates when we open this URL in a web browser or when I use Starscream on iOS.

ianpartridge commented 5 years ago

If you are writing a client socket that needs to connect over TLS to a remote server you don't need a certificate - it's the server which has the certificate. I think you create an SSLService.Configuration() (no parameters) and SSLService, then set your socket's delegate to use it.

See https://github.com/IBM-Swift/BlueSSLService#creating-and-using-the-sslservice

sglushchenko commented 5 years ago

@ianpartridge Oh. We can create SSLService without parameters :) Thanks, it maybe helps. I'll try it. I think need to add it to readme.

ianpartridge commented 5 years ago

It does say "or, No certificate at all" but I agree there could be an example showing this fully. I'll raise an issue over there. Thanks!

ianpartridge commented 5 years ago

https://github.com/IBM-Swift/BlueSSLService/issues/70