websocket icon indicating copy to clipboard operation
websocket copied to clipboard

the lack of client code

Open cqqqq777 opened this issue 2 years ago • 5 comments

当我使用hertz-contrib/websocket时发现缺少了一些客户端的方法,类似gorilla/websocket中的Dial方法:https://github.com/gorilla/websocket/blob/master/client.go#L116 image

希望在以后的维护中可以加入有关客户端的方法

cqqqq777 avatar Mar 13 '23 10:03 cqqqq777

Currently, we may not have enough time to put into this. I will put the good first issue tag for it first. If you are interested in it, any PR is welcome.

welkeyever avatar Mar 15 '23 06:03 welkeyever

@welkeyever I am new to open source and I had to translate what @cqqqq777 said. So just to confirm that I have understood correctly. We need to add missing client methods in hertz-contrib/websocket, and I can refer to gorilla/websocket. One of them in Dial but we might need others as well. Please tell me if there is anything else in the req.

shivamganwani avatar Apr 29 '23 12:04 shivamganwani

@shivamganwani Sorry for the late, I just came back from vacation. Yes, it is open to do so like your said - mostly the dial and related APIs - regarding gorilla/websocket. Let me know if you are interested in it, and I will assign it to you🫡

welkeyever avatar May 04 '23 02:05 welkeyever

@welkeyever I want to patch hertz/contrib/websocket to support websocket client,based on hertz client,but found it is difficult. because the hertz client do not provide any function to access current connection after response 101 and switch protocol to websocket. what i can do is reading body streamly. Is there any suggestion?

qleein avatar Oct 18 '23 10:10 qleein

@qleein Good point! It seems like we need to open a door for client to hijack the connection. If you are interested in the follow-up and task dismantling, you may lit up an issue here, and do it. Or I will come back later and take a closer look after the things at hand are over.

welkeyever avatar Oct 19 '23 03:10 welkeyever

Fixed in #24 , check test for example.

xiaost avatar Nov 11 '24 06:11 xiaost