Lines Matching refs:ws

19     ws = TestApplicationWebsocket()  variable in TestASGIWebsockets
32 self.ws.frame_write(sock, self.ws.OP_CLOSE, self.ws.serialize_close())
38 frame = self.ws.frame_read(sock)
41 assert frame['opcode'] == self.ws.OP_CLOSE, 'close opcode'
48 if opcode == self.ws.OP_BINARY or not decode:
60 resp, sock, key = self.ws.upgrade()
66 assert resp['headers']['Sec-WebSocket-Accept'] == self.ws.accept(
76 resp, sock, key = self.ws.upgrade()
90 _, sock, _ = self.ws.upgrade()
92 self.ws.frame_write(sock, self.ws.OP_TEXT, message)
93 frame = self.ws.frame_read(sock)
97 self.ws.frame_write(sock, self.ws.OP_TEXT, message)
98 frame = self.ws.frame_read(sock)
109 _, sock, _ = self.ws.upgrade()
111 self.ws.frame_write(sock, self.ws.OP_TEXT, message)
112 frame = self.ws.frame_read(sock)
118 self.ws.frame_write(sock, self.ws.OP_TEXT, message)
119 frame = self.ws.frame_read(sock)
130 _, sock, _ = self.ws.upgrade()
132 self.ws.frame_write(sock, self.ws.OP_TEXT, message, mask=False)
134 frame = self.ws.frame_read(sock)
136 assert frame['opcode'] == self.ws.OP_CLOSE, 'no mask opcode'
146 _, sock, _ = self.ws.upgrade()
148 self.ws.frame_write(sock, self.ws.OP_TEXT, message, fin=False)
149 self.ws.frame_write(sock, self.ws.OP_CONT, ' ', fin=False)
150 self.ws.frame_write(sock, self.ws.OP_CONT, message)
152 frame = self.ws.frame_read(sock)
163 _, sock, _ = self.ws.upgrade()
165 self.ws.frame_write(sock, self.ws.OP_TEXT, 'fragment1', fin=False)
166 self.ws.frame_write(
167 sock, self.ws.OP_CONT, 'fragment2', length=2**64 - 1
177 _, sock, _ = self.ws.upgrade()
179 self.ws.frame_write(sock, self.ws.OP_PING, message, fin=False)
181 frame = self.ws.frame_read(sock)
189 'opcode': self.ws.OP_CLOSE,
202 _, sock, _ = self.ws.upgrade()
204 self.ws.frame_write(sock, self.ws.OP_TEXT, message)
206 frame = self.ws.frame_read(sock)
209 frame = self.ws.frame_read(sock)
222 _, sock1, _ = self.ws.upgrade()
223 _, sock2, _ = self.ws.upgrade()
225 self.ws.frame_write(sock1, self.ws.OP_TEXT, message1)
226 self.ws.frame_write(sock2, self.ws.OP_TEXT, message2)
228 frame1 = self.ws.frame_read(sock1)
229 frame2 = self.ws.frame_read(sock2)
247 'Sec-WebSocket-Key': self.ws.key(),
258 resp, sock, _ = self.ws.upgrade(
263 'Sec-WebSocket-Key': self.ws.key(),
280 'Sec-WebSocket-Key': self.ws.key(),
296 'Sec-WebSocket-Key': self.ws.key(),
320 key = self.ws.key()
344 'Sec-WebSocket-Key': self.ws.key(),
360 'Sec-WebSocket-Key': self.ws.key(),
377 'Sec-WebSocket-Key': self.ws.key(),
389 key = self.ws.key()
390 resp, sock, _ = self.ws.upgrade(
404 assert resp['headers']['Sec-WebSocket-Accept'] == self.ws.accept(
417 opcode = self.ws.OP_TEXT
419 _, sock, _ = self.ws.upgrade()
424 self.ws.frame_write(sock, opcode, payload, chopsize=chopsize)
426 frame = self.ws.frame_read(sock)
443 opcode = self.ws.OP_BINARY
445 _, sock, _ = self.ws.upgrade()
450 self.ws.frame_write(sock, opcode, payload, chopsize=chopsize)
451 frame = self.ws.frame_read(sock)
469 op_ping = self.ws.OP_PING
470 op_pong = self.ws.OP_PONG
472 _, sock, _ = self.ws.upgrade()
475 self.ws.frame_write(sock, op_ping, payload, chopsize=chopsize)
476 frame = self.ws.frame_read(sock)
490 _, sock, _ = self.ws.upgrade()
492 self.ws.frame_write(sock, self.ws.OP_PING, b'\xfe' * 126)
500 _, sock, _ = self.ws.upgrade()
502 self.ws.frame_write(sock, self.ws.OP_PONG, '')
507 self.ws.frame_write(sock, self.ws.OP_PONG, 'unsolicited pong payload')
514 self.ws.frame_write(sock, self.ws.OP_PONG, 'unsolicited pong payload')
515 self.ws.frame_write(sock, self.ws.OP_PING, payload)
517 frame = self.ws.frame_read(sock)
518 self.check_frame(frame, True, self.ws.OP_PONG, payload)
527 _, sock, _ = self.ws.upgrade()
530 self.ws.frame_write(sock, self.ws.OP_PING, 'payload-%d' % i)
533 frame = self.ws.frame_read(sock)
534 self.check_frame(frame, True, self.ws.OP_PONG, 'payload-%d' % i)
539 opcode = self.ws.OP_PING
540 self.ws.frame_write(sock, opcode, 'payload-%d' % i, chopsize=1)
543 frame = self.ws.frame_read(sock)
544 self.check_frame(frame, True, self.ws.OP_PONG, 'payload-%d' % i)
556 _, sock, _ = self.ws.upgrade()
558 self.ws.frame_write(sock, self.ws.OP_TEXT, payload, rsv1=True)
563 _, sock, _ = self.ws.upgrade()
565 self.ws.frame_write(sock, self.ws.OP_TEXT, payload)
566 self.ws.frame_write(sock, self.ws.OP_TEXT, payload, rsv2=True)
567 self.ws.frame_write(sock, self.ws.OP_PING, '')
569 frame = self.ws.frame_read(sock)
570 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
579 _, sock, _ = self.ws.upgrade()
581 self.ws.frame_write(sock, self.ws.OP_TEXT, payload)
583 frame = self.ws.frame_read(sock)
584 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
586 self.ws.frame_write(
587 sock, self.ws.OP_TEXT, payload, rsv1=True, rsv2=True
597 _, sock, _ = self.ws.upgrade()
599 self.ws.frame_write(sock, self.ws.OP_TEXT, payload, chopsize=1)
600 self.ws.frame_write(
601 sock, self.ws.OP_TEXT, payload, rsv3=True, chopsize=1
603 self.ws.frame_write(sock, self.ws.OP_PING, '')
605 frame = self.ws.frame_read(sock)
606 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
615 _, sock, _ = self.ws.upgrade()
617 self.ws.frame_write(
619 self.ws.OP_BINARY,
629 _, sock, _ = self.ws.upgrade()
631 self.ws.frame_write(
632 sock, self.ws.OP_PING, payload, rsv2=True, rsv3=True
639 _, sock, _ = self.ws.upgrade()
641 self.ws.frame_write(
642 sock, self.ws.OP_CLOSE, payload, rsv1=True, rsv2=True, rsv3=True
654 _, sock, _ = self.ws.upgrade()
656 self.ws.frame_write(sock, 0x03, '')
661 _, sock, _ = self.ws.upgrade()
663 self.ws.frame_write(sock, 0x04, 'reserved opcode payload')
668 _, sock, _ = self.ws.upgrade()
670 self.ws.frame_write(sock, self.ws.OP_TEXT, payload)
672 frame = self.ws.frame_read(sock)
673 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
675 self.ws.frame_write(sock, 0x05, '')
676 self.ws.frame_write(sock, self.ws.OP_PING, '')
682 _, sock, _ = self.ws.upgrade()
684 self.ws.frame_write(sock, self.ws.OP_TEXT, payload)
686 frame = self.ws.frame_read(sock)
687 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
689 self.ws.frame_write(sock, 0x06, payload)
690 self.ws.frame_write(sock, self.ws.OP_PING, '')
696 _, sock, _ = self.ws.upgrade()
698 self.ws.frame_write(sock, self.ws.OP_TEXT, payload, chopsize=1)
700 frame = self.ws.frame_read(sock)
701 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
703 self.ws.frame_write(sock, 0x07, payload, chopsize=1)
704 self.ws.frame_write(sock, self.ws.OP_PING, '')
710 _, sock, _ = self.ws.upgrade()
712 self.ws.frame_write(sock, 0x0B, '')
717 _, sock, _ = self.ws.upgrade()
719 self.ws.frame_write(sock, 0x0C, 'reserved opcode payload')
724 _, sock, _ = self.ws.upgrade()
726 self.ws.frame_write(sock, self.ws.OP_TEXT, payload)
728 frame = self.ws.frame_read(sock)
729 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
731 self.ws.frame_write(sock, 0x0D, '')
732 self.ws.frame_write(sock, self.ws.OP_PING, '')
738 _, sock, _ = self.ws.upgrade()
740 self.ws.frame_write(sock, self.ws.OP_TEXT, payload)
742 frame = self.ws.frame_read(sock)
743 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
745 self.ws.frame_write(sock, 0x0E, payload)
746 self.ws.frame_write(sock, self.ws.OP_PING, '')
752 _, sock, _ = self.ws.upgrade()
754 self.ws.frame_write(sock, self.ws.OP_TEXT, payload, chopsize=1)
756 frame = self.ws.frame_read(sock)
757 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
759 self.ws.frame_write(sock, 0x0F, payload, chopsize=1)
760 self.ws.frame_write(sock, self.ws.OP_PING, '')
769 _, sock, _ = self.ws.upgrade()
771 self.ws.frame_write(sock, self.ws.OP_PING, 'fragment1', fin=False)
772 self.ws.frame_write(sock, self.ws.OP_CONT, 'fragment2', fin=True)
777 _, sock, _ = self.ws.upgrade()
779 self.ws.frame_write(sock, self.ws.OP_PONG, 'fragment1', fin=False)
780 self.ws.frame_write(sock, self.ws.OP_CONT, 'fragment2', fin=True)
785 _, sock, _ = self.ws.upgrade()
787 self.ws.frame_write(sock, self.ws.OP_TEXT, 'fragment1', fin=False)
788 self.ws.frame_write(sock, self.ws.OP_CONT, 'fragment2', fin=True)
790 frame = self.ws.frame_read(sock)
791 self.check_frame(frame, True, self.ws.OP_TEXT, 'fragment1fragment2')
795 self.ws.frame_write(sock, self.ws.OP_TEXT, 'fragment1', fin=False)
797 self.ws.frame_write(sock, self.ws.OP_CONT, 'fragment2', fin=True)
799 frame = self.ws.frame_read(sock)
800 self.check_frame(frame, True, self.ws.OP_TEXT, 'fragment1fragment2')
804 self.ws.frame_write(
805 sock, self.ws.OP_TEXT, 'fragment1', fin=False, chopsize=1
807 self.ws.frame_write(
808 sock, self.ws.OP_CONT, 'fragment2', fin=True, chopsize=1
811 frame = self.ws.frame_read(sock)
812 self.check_frame(frame, True, self.ws.OP_TEXT, 'fragment1fragment2')
818 self.ws.frame_write(sock, self.ws.OP_TEXT, 'fragment1', fin=False)
819 self.ws.frame_write(sock, self.ws.OP_PING, ping_payload)
820 self.ws.frame_write(sock, self.ws.OP_CONT, 'fragment2', fin=True)
822 frame = self.ws.frame_read(sock)
823 self.check_frame(frame, True, self.ws.OP_PONG, ping_payload)
825 frame = self.ws.frame_read(sock)
826 self.check_frame(frame, True, self.ws.OP_TEXT, 'fragment1fragment2')
832 self.ws.frame_write(sock, self.ws.OP_TEXT, 'fragment1', fin=False)
835 self.ws.frame_write(sock, self.ws.OP_PING, ping_payload)
837 frame = self.ws.frame_read(sock)
838 self.check_frame(frame, True, self.ws.OP_PONG, ping_payload)
840 self.ws.frame_write(sock, self.ws.OP_CONT, 'fragment2', fin=True)
842 frame = self.ws.frame_read(sock)
843 self.check_frame(frame, True, self.ws.OP_TEXT, 'fragment1fragment2')
849 self.ws.frame_write(
850 sock, self.ws.OP_TEXT, 'fragment1', fin=False, chopsize=1
852 self.ws.frame_write(sock, self.ws.OP_PING, ping_payload, chopsize=1)
853 self.ws.frame_write(
854 sock, self.ws.OP_CONT, 'fragment2', fin=True, chopsize=1
857 frame = self.ws.frame_read(sock)
858 self.check_frame(frame, True, self.ws.OP_PONG, ping_payload)
860 frame = self.ws.frame_read(sock)
861 self.check_frame(frame, True, self.ws.OP_TEXT, 'fragment1fragment2')
865 self.ws.frame_write(
866 sock, self.ws.OP_CONT, 'non-continuation payload', fin=True
868 self.ws.frame_write(sock, self.ws.OP_TEXT, 'Hello, world!', fin=True)
873 _, sock, _ = self.ws.upgrade()
875 self.ws.frame_write(
876 sock, self.ws.OP_CONT, 'non-continuation payload', fin=True
878 self.ws.frame_write(sock, self.ws.OP_TEXT, 'Hello, world!', fin=True)
883 _, sock, _ = self.ws.upgrade()
885 self.ws.frame_write(
887 self.ws.OP_CONT,
892 self.ws.frame_write(
893 sock, self.ws.OP_TEXT, 'Hello, world!', fin=True, chopsize=1
899 _, sock, _ = self.ws.upgrade()
901 self.ws.frame_write(
902 sock, self.ws.OP_CONT, 'non-continuation payload', fin=False
904 self.ws.frame_write(sock, self.ws.OP_TEXT, 'Hello, world!', fin=True)
909 _, sock, _ = self.ws.upgrade()
911 self.ws.frame_write(
912 sock, self.ws.OP_CONT, 'non-continuation payload', fin=False
914 self.ws.frame_write(sock, self.ws.OP_TEXT, 'Hello, world!', fin=True)
919 _, sock, _ = self.ws.upgrade()
921 self.ws.frame_write(
923 self.ws.OP_CONT,
928 self.ws.frame_write(
929 sock, self.ws.OP_TEXT, 'Hello, world!', fin=True, chopsize=1
935 _, sock, _ = self.ws.upgrade()
937 self.ws.frame_write(sock, self.ws.OP_TEXT, 'fragment1', fin=False)
938 self.ws.frame_write(sock, self.ws.OP_CONT, 'fragment2', fin=True)
939 self.ws.frame_write(sock, self.ws.OP_CONT, 'fragment3', fin=False)
940 self.ws.frame_write(sock, self.ws.OP_TEXT, 'fragment4', fin=True)
942 frame = self.ws.frame_read(sock)
944 if frame['opcode'] == self.ws.OP_TEXT:
945 self.check_frame(frame, True, self.ws.OP_TEXT, 'fragment1fragment2')
952 _, sock, _ = self.ws.upgrade()
955 self.ws.frame_write(sock, self.ws.OP_CONT, 'fragment1', fin=False)
956 self.ws.frame_write(sock, self.ws.OP_TEXT, 'fragment2', fin=False)
957 self.ws.frame_write(sock, self.ws.OP_CONT, 'fragment3', fin=True)
962 _, sock, _ = self.ws.upgrade()
965 self.ws.frame_write(sock, self.ws.OP_CONT, 'fragment1', fin=True)
966 self.ws.frame_write(sock, self.ws.OP_TEXT, 'fragment2', fin=False)
967 self.ws.frame_write(sock, self.ws.OP_CONT, 'fragment3', fin=True)
972 _, sock, _ = self.ws.upgrade()
974 self.ws.frame_write(sock, self.ws.OP_TEXT, 'fragment1', fin=False)
975 self.ws.frame_write(sock, self.ws.OP_TEXT, 'fragment2')
980 _, sock, _ = self.ws.upgrade()
982 self.ws.frame_write(sock, self.ws.OP_TEXT, 'fragment1', fin=False)
983 self.ws.frame_write(sock, self.ws.OP_CONT, 'fragment2', fin=False)
984 self.ws.frame_write(sock, self.ws.OP_PING, 'pongme 1!')
988 self.ws.frame_write(sock, self.ws.OP_CONT, 'fragment3', fin=False)
989 self.ws.frame_write(sock, self.ws.OP_CONT, 'fragment4', fin=False)
990 self.ws.frame_write(sock, self.ws.OP_PING, 'pongme 2!')
991 self.ws.frame_write(sock, self.ws.OP_CONT, 'fragment5')
993 frame = self.ws.frame_read(sock)
994 self.check_frame(frame, True, self.ws.OP_PONG, 'pongme 1!')
996 frame = self.ws.frame_read(sock)
997 self.check_frame(frame, True, self.ws.OP_PONG, 'pongme 2!')
1000 self.ws.frame_read(sock),
1002 self.ws.OP_TEXT,
1008 self.ws.frame_write(sock, self.ws.OP_TEXT, 'fragment1', fin=False)
1009 self.ws.frame_write(sock, self.ws.OP_CONT, 'fragment2', fin=False)
1010 self.ws.frame_write(sock, self.ws.OP_PING, 'pongme 1!')
1012 frame = self.ws.frame_read(sock)
1013 self.check_frame(frame, True, self.ws.OP_PONG, 'pongme 1!')
1017 self.ws.frame_write(sock, self.ws.OP_CONT, 'fragment3', fin=False)
1018 self.ws.frame_write(sock, self.ws.OP_CONT, 'fragment4', fin=False)
1019 self.ws.frame_write(sock, self.ws.OP_PING, 'pongme 2!')
1021 frame = self.ws.frame_read(sock)
1022 self.check_frame(frame, True, self.ws.OP_PONG, 'pongme 2!')
1025 self.ws.frame_write(sock, self.ws.OP_CONT, 'fragment5')
1028 self.ws.frame_read(sock),
1030 self.ws.OP_TEXT,
1041 _, sock, _ = self.ws.upgrade()
1043 self.ws.frame_write(sock, self.ws.OP_TEXT, '')
1044 frame = self.ws.frame_read(sock)
1045 self.check_frame(frame, True, self.ws.OP_TEXT, '')
1049 self.ws.frame_write(sock, self.ws.OP_TEXT, '', fin=False)
1050 self.ws.frame_write(sock, self.ws.OP_CONT, '', fin=False)
1051 self.ws.frame_write(sock, self.ws.OP_CONT, '')
1053 frame = self.ws.frame_read(sock)
1054 self.check_frame(frame, True, self.ws.OP_TEXT, '')
1060 self.ws.frame_write(sock, self.ws.OP_TEXT, '', fin=False)
1061 self.ws.frame_write(sock, self.ws.OP_CONT, payload, fin=False)
1062 self.ws.frame_write(sock, self.ws.OP_CONT, '')
1064 frame = self.ws.frame_read(sock)
1065 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
1071 self.ws.frame_write(sock, self.ws.OP_TEXT, payload)
1073 frame = self.ws.frame_read(sock)
1074 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
1078 self.ws.frame_write(sock, self.ws.OP_TEXT, payload[:12], fin=False)
1079 self.ws.frame_write(sock, self.ws.OP_CONT, payload[12:])
1081 frame = self.ws.frame_read(sock)
1082 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
1086 self.ws.message(sock, self.ws.OP_TEXT, payload, fragmention_size=1)
1088 frame = self.ws.frame_read(sock)
1089 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
1095 self.ws.message(sock, self.ws.OP_TEXT, payload, fragmention_size=1)
1097 frame = self.ws.frame_read(sock)
1098 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
1129 _, sock, _ = self.ws.upgrade()
1133 self.ws.frame_write(sock, self.ws.OP_TEXT, payload)
1135 frame = self.ws.frame_read(sock)
1136 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
1142 _, sock, _ = self.ws.upgrade()
1144 self.ws.frame_write(sock, self.ws.OP_CLOSE, self.ws.serialize_close())
1145 self.ws.frame_write(sock, self.ws.OP_CLOSE, self.ws.serialize_close())
1151 _, sock, _ = self.ws.upgrade()
1153 self.ws.frame_write(sock, self.ws.OP_CLOSE, self.ws.serialize_close())
1156 self.ws.frame_write(sock, self.ws.OP_PING, '')
1163 _, sock, _ = self.ws.upgrade()
1165 self.ws.frame_write(sock, self.ws.OP_CLOSE, self.ws.serialize_close())
1168 self.ws.frame_write(sock, self.ws.OP_TEXT, payload)
1175 _, sock, _ = self.ws.upgrade()
1177 self.ws.frame_write(sock, self.ws.OP_TEXT, 'fragment1', fin=False)
1178 self.ws.frame_write(sock, self.ws.OP_CLOSE, self.ws.serialize_close())
1181 self.ws.frame_write(sock, self.ws.OP_CONT, 'fragment2')
1188 _, sock, _ = self.ws.upgrade()
1190 self.ws.frame_write(sock, self.ws.OP_TEXT, 'BAsd7&jh23' * 26 * 2**10)
1191 self.ws.frame_write(sock, self.ws.OP_TEXT, payload)
1192 self.ws.frame_write(sock, self.ws.OP_CLOSE, self.ws.serialize_close())
1196 self.ws.frame_write(sock, self.ws.OP_PING, '')
1203 _, sock, _ = self.ws.upgrade()
1205 self.ws.frame_write(sock, self.ws.OP_CLOSE, '')
1210 _, sock, _ = self.ws.upgrade()
1212 self.ws.frame_write(sock, self.ws.OP_CLOSE, 'a')
1217 _, sock, _ = self.ws.upgrade()
1219 self.ws.frame_write(sock, self.ws.OP_CLOSE, self.ws.serialize_close())
1224 _, sock, _ = self.ws.upgrade()
1226 payload = self.ws.serialize_close(reason='Hello World!')
1228 self.ws.frame_write(sock, self.ws.OP_CLOSE, payload)
1233 _, sock, _ = self.ws.upgrade()
1235 payload = self.ws.serialize_close(reason='*' * 123)
1237 self.ws.frame_write(sock, self.ws.OP_CLOSE, payload)
1242 _, sock, _ = self.ws.upgrade()
1244 payload = self.ws.serialize_close(reason='*' * 124)
1246 self.ws.frame_write(sock, self.ws.OP_CLOSE, payload)
1281 _, sock, _ = self.ws.upgrade()
1283 payload = self.ws.serialize_close(code=code)
1285 self.ws.frame_write(sock, self.ws.OP_CLOSE, payload)
1289 _, sock, _ = self.ws.upgrade()
1291 payload = self.ws.serialize_close(code=code)
1293 self.ws.frame_write(sock, self.ws.OP_CLOSE, payload)
1301 _, sock, _ = self.ws.upgrade()
1303 payload = self.ws.serialize_close(code=5000)
1305 self.ws.frame_write(sock, self.ws.OP_CLOSE, payload)
1310 _, sock, _ = self.ws.upgrade()
1314 self.ws.frame_write(sock, self.ws.OP_CLOSE, payload)
1335 _, sock, _ = self.ws.upgrade()
1337 op_text = self.ws.OP_TEXT
1338 op_binary = self.ws.OP_BINARY
1341 if opcode == self.ws.OP_TEXT:
1346 self.ws.frame_write(sock, opcode, payload, chopsize=chopsize)
1347 frame = self.ws.frame_read(sock, read_timeout=5)
1351 if opcode == self.ws.OP_TEXT:
1356 self.ws.message(sock, opcode, payload, fragmention_size=f_size)
1357 frame = self.ws.frame_read(sock, read_timeout=5)
1414 _, sock, _ = self.ws.upgrade()
1418 self.ws.message(sock, self.ws.OP_TEXT, payload, fragmention_size=1300)
1420 frame = self.ws.frame_read(sock)
1421 self.check_frame(frame, True, self.ws.OP_TEXT, payload)
1434 _, sock, _ = self.ws.upgrade()
1437 opcode = self.ws.OP_TEXT
1439 self.ws.frame_write(sock, opcode, payload) # frame length is 100
1441 frame = self.ws.frame_read(sock)
1446 self.ws.frame_write(sock, opcode, payload) # frame length is 101
1456 _, sock, _ = self.ws.upgrade()
1458 frame = self.ws.frame_to_send(self.ws.OP_TEXT, 'blah')
1472 _, sock, _ = self.ws.upgrade()
1474 frame = self.ws.frame_to_send(self.ws.OP_TEXT, 'blah')
1479 frame = self.ws.frame_read(sock)
1480 self.check_frame(frame, True, self.ws.OP_PING, '') # PING frame
1489 _, sock, _ = self.ws.upgrade()
1493 self.ws.frame_write(sock, self.ws.OP_TEXT, message)
1495 frame = self.ws.frame_read(sock)