How do you send data to a web socket using curl?
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I'm using a bash shell and tryhin gto communicate with a web socket.
I found this script -- https://gist.github.com/htp/fbce19069187ec1cc486b594104f01d0 that is supposed to connect to a web socket, but it doesn't list the parameters if you actually need to pass along data to the endpoint. How is that done?
If curl is not up to the task I'm open to anther command line tool. THe point is not to use curl, but to see stuff in action from the comamnd line.
bash shell-script curl socket
add a comment |Â
up vote
1
down vote
favorite
I'm using a bash shell and tryhin gto communicate with a web socket.
I found this script -- https://gist.github.com/htp/fbce19069187ec1cc486b594104f01d0 that is supposed to connect to a web socket, but it doesn't list the parameters if you actually need to pass along data to the endpoint. How is that done?
If curl is not up to the task I'm open to anther command line tool. THe point is not to use curl, but to see stuff in action from the comamnd line.
bash shell-script curl socket
There are some useful answers in stackoverflow.com/questions/47860689/â¦
â Matheus Santana
Mar 23 at 11:17
Neither of these answers submits data when connecting to teh web socket and one of them uses curl. Am I missing something?
â Dave
Mar 23 at 19:06
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I'm using a bash shell and tryhin gto communicate with a web socket.
I found this script -- https://gist.github.com/htp/fbce19069187ec1cc486b594104f01d0 that is supposed to connect to a web socket, but it doesn't list the parameters if you actually need to pass along data to the endpoint. How is that done?
If curl is not up to the task I'm open to anther command line tool. THe point is not to use curl, but to see stuff in action from the comamnd line.
bash shell-script curl socket
I'm using a bash shell and tryhin gto communicate with a web socket.
I found this script -- https://gist.github.com/htp/fbce19069187ec1cc486b594104f01d0 that is supposed to connect to a web socket, but it doesn't list the parameters if you actually need to pass along data to the endpoint. How is that done?
If curl is not up to the task I'm open to anther command line tool. THe point is not to use curl, but to see stuff in action from the comamnd line.
bash shell-script curl socket
edited Mar 22 at 21:43
asked Mar 22 at 21:28
Dave
368827
368827
There are some useful answers in stackoverflow.com/questions/47860689/â¦
â Matheus Santana
Mar 23 at 11:17
Neither of these answers submits data when connecting to teh web socket and one of them uses curl. Am I missing something?
â Dave
Mar 23 at 19:06
add a comment |Â
There are some useful answers in stackoverflow.com/questions/47860689/â¦
â Matheus Santana
Mar 23 at 11:17
Neither of these answers submits data when connecting to teh web socket and one of them uses curl. Am I missing something?
â Dave
Mar 23 at 19:06
There are some useful answers in stackoverflow.com/questions/47860689/â¦
â Matheus Santana
Mar 23 at 11:17
There are some useful answers in stackoverflow.com/questions/47860689/â¦
â Matheus Santana
Mar 23 at 11:17
Neither of these answers submits data when connecting to teh web socket and one of them uses curl. Am I missing something?
â Dave
Mar 23 at 19:06
Neither of these answers submits data when connecting to teh web socket and one of them uses curl. Am I missing something?
â Dave
Mar 23 at 19:06
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
1
down vote
The script you've found only sends the headers needed to establish the initial Websockets handshake. And you also need to actually show you the headers from the response and understand these to determine if the handshake was successful. But apart from being usable to test the initial handshake curl has no support for Websockets, i.e. it is impossible to actually exchange data using Websockets with curl.
Is there another command line tool that does this? I will edit my question b/c I'm not married to curl.
â Dave
Mar 22 at 21:42
@Dave: A simply search for command line tool websocket provides you with several tools.
â Steffen Ullrich
Mar 22 at 21:44
add a comment |Â
up vote
0
down vote
I suggest you to use my new tool websocat.
echo "Some data to be sent" | websocat ws://server/url
Obviously, there are also alternatives like wscat (golang) or wscat (node).
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
The script you've found only sends the headers needed to establish the initial Websockets handshake. And you also need to actually show you the headers from the response and understand these to determine if the handshake was successful. But apart from being usable to test the initial handshake curl has no support for Websockets, i.e. it is impossible to actually exchange data using Websockets with curl.
Is there another command line tool that does this? I will edit my question b/c I'm not married to curl.
â Dave
Mar 22 at 21:42
@Dave: A simply search for command line tool websocket provides you with several tools.
â Steffen Ullrich
Mar 22 at 21:44
add a comment |Â
up vote
1
down vote
The script you've found only sends the headers needed to establish the initial Websockets handshake. And you also need to actually show you the headers from the response and understand these to determine if the handshake was successful. But apart from being usable to test the initial handshake curl has no support for Websockets, i.e. it is impossible to actually exchange data using Websockets with curl.
Is there another command line tool that does this? I will edit my question b/c I'm not married to curl.
â Dave
Mar 22 at 21:42
@Dave: A simply search for command line tool websocket provides you with several tools.
â Steffen Ullrich
Mar 22 at 21:44
add a comment |Â
up vote
1
down vote
up vote
1
down vote
The script you've found only sends the headers needed to establish the initial Websockets handshake. And you also need to actually show you the headers from the response and understand these to determine if the handshake was successful. But apart from being usable to test the initial handshake curl has no support for Websockets, i.e. it is impossible to actually exchange data using Websockets with curl.
The script you've found only sends the headers needed to establish the initial Websockets handshake. And you also need to actually show you the headers from the response and understand these to determine if the handshake was successful. But apart from being usable to test the initial handshake curl has no support for Websockets, i.e. it is impossible to actually exchange data using Websockets with curl.
answered Mar 22 at 21:33
Steffen Ullrich
1,311711
1,311711
Is there another command line tool that does this? I will edit my question b/c I'm not married to curl.
â Dave
Mar 22 at 21:42
@Dave: A simply search for command line tool websocket provides you with several tools.
â Steffen Ullrich
Mar 22 at 21:44
add a comment |Â
Is there another command line tool that does this? I will edit my question b/c I'm not married to curl.
â Dave
Mar 22 at 21:42
@Dave: A simply search for command line tool websocket provides you with several tools.
â Steffen Ullrich
Mar 22 at 21:44
Is there another command line tool that does this? I will edit my question b/c I'm not married to curl.
â Dave
Mar 22 at 21:42
Is there another command line tool that does this? I will edit my question b/c I'm not married to curl.
â Dave
Mar 22 at 21:42
@Dave: A simply search for command line tool websocket provides you with several tools.
â Steffen Ullrich
Mar 22 at 21:44
@Dave: A simply search for command line tool websocket provides you with several tools.
â Steffen Ullrich
Mar 22 at 21:44
add a comment |Â
up vote
0
down vote
I suggest you to use my new tool websocat.
echo "Some data to be sent" | websocat ws://server/url
Obviously, there are also alternatives like wscat (golang) or wscat (node).
add a comment |Â
up vote
0
down vote
I suggest you to use my new tool websocat.
echo "Some data to be sent" | websocat ws://server/url
Obviously, there are also alternatives like wscat (golang) or wscat (node).
add a comment |Â
up vote
0
down vote
up vote
0
down vote
I suggest you to use my new tool websocat.
echo "Some data to be sent" | websocat ws://server/url
Obviously, there are also alternatives like wscat (golang) or wscat (node).
I suggest you to use my new tool websocat.
echo "Some data to be sent" | websocat ws://server/url
Obviously, there are also alternatives like wscat (golang) or wscat (node).
answered Jul 4 at 17:22
Vi.
2,27731936
2,27731936
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f432940%2fhow-do-you-send-data-to-a-web-socket-using-curl%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
There are some useful answers in stackoverflow.com/questions/47860689/â¦
â Matheus Santana
Mar 23 at 11:17
Neither of these answers submits data when connecting to teh web socket and one of them uses curl. Am I missing something?
â Dave
Mar 23 at 19:06