You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am suggesting a new feature, not asking a question
Description
in this function, it prevent user to send data in OPCODE_BINARY, so I suggest to export websocket 'opcode' param to user as bellow。
# def send(self, body, name=None, context={}, opcode=websocket.ABNF.OPCODE_TEXT)
def send(self, body, name=None, context={}):
if not name:
if body == "2":
name = "2 heartbeat"
else:
# hoping this is a subscribe type message, try to detect name
m = re.search(r'(\d*)\["([a-z]*)"', body)
assert m is not None
code = m.group(1)
action = m.group(2)
url_part = re.search(r'"url": *"([^"]*)"', body)
assert url_part is not None
url = re.sub(r"/[0-9_]*/", "/:id/", url_part.group(1))
name = f"{code} {action} url: {url}"
self.environment.events.request.fire(
request_type="WSS",
name=name,
response_time=None,
response_length=len(body),
exception=None,
context={**self.context(), **context},
)
logging.debug(f"WSS: {body}")
# self.ws.send(body, opcode)
self.ws.send(body)
The text was updated successfully, but these errors were encountered:
Prerequisites
Description
in this function, it prevent user to send data in OPCODE_BINARY, so I suggest to export websocket 'opcode' param to user as bellow。
The text was updated successfully, but these errors were encountered: