Raised This Month: $51 Target: $400
 12% 

Solved [Socket] Websocket Payload


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
RumbleFrog
Great Tester of Whatever
Join Date: Dec 2016
Location: Fish Tank
Old 07-20-2017 , 00:05   [Socket] Websocket Payload
Reply With Quote #1

Can anyone show me how to pack frame with payloads with WebSocket specs using socket?

I got the upgrade header down; I'm having a problem sending the JSON payload now.

An example would be https://github.com/peace-maker/sm-we...ocket.sp#L1271, but I'm not sure how to use it for myself.

Last edited by RumbleFrog; 07-24-2017 at 16:33.
RumbleFrog is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 07-20-2017 , 02:46   Re: [Socket] Websocket Payload
Reply With Quote #2

Why don't you use a regular socket without the protocol overhead of a websocket?
__________________
Peace-Maker is offline
RumbleFrog
Great Tester of Whatever
Join Date: Dec 2016
Location: Fish Tank
Old 07-20-2017 , 03:23   Re: [Socket] Websocket Payload
Reply With Quote #3

Quote:
Originally Posted by Peace-Maker View Post
Why don't you use a regular socket without the protocol overhead of a websocket?
I suppose I could, but all these JS libraries all use web socket protcol
RumbleFrog is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 07-22-2017 , 07:21   Re: [Socket] Websocket Payload
Reply With Quote #4

Do you want to use WebSockets just because of some JavaScript libraries? Otherwise I think it would be much easier to send JSON over HTTP.
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.
DJ Tsunami is offline
RumbleFrog
Great Tester of Whatever
Join Date: Dec 2016
Location: Fish Tank
Old 07-24-2017 , 16:33   Re: [Socket] Websocket Payload
Reply With Quote #5

Quote:
Originally Posted by DJ Tsunami View Post
Do you want to use WebSockets just because of some JavaScript libraries? Otherwise I think it would be much easier to send JSON over HTTP.
I've made my own socket protocol, and there's way too much overhead with standard HTTP calls.
RumbleFrog is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:30.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode