Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
flow.cpython-313.pyc74 linesDownload Raw Back to __pycache__
1�

2��ja%����SSKJr SSKrSSKrSSKrSSKrSSKJr SSKJr SSK	J3r4 SSK	Jr SSKJ
r
 SSKJr SS	KJr SS5KJr \"SS\R$55r"S
S\R(5rSS/rg)�)�annotationsN)�	dataclass)�field)�Any)�ClassVar)�6connection)�7exceptions)�version)�serializablec�l�\rSrSr%SrS\S'\"\RS9rS\S'Sr	S	\S8'Sr9SrS
rg)�Error�a910An Error.11 12This is distinct from an protocol error response (say, a HTTP code 500),13which is represented by a normal `mitmproxy.http.Response` object. This class is14responsible for indicating errors that fall outside of normal protocol15communications, like interrupted connections, timeouts, or protocol errors.16�str�msg)�default_factory�float�	timestampzConnection killed.�
ClassVar[str]�KILLED_MESSAGEc��UR$�N�r��selfs �TD:\code\apps\devtools\python\user_packages\Python313\site-packages\mitmproxy/flow.py�__str__�
Error.__str__%����x�x��c��UR$rrrs r�__repr__�Error.__repr__(rr�N)
�__name__�17__module__�__qualname__�__firstlineno__�__doc__�__annotations__r�timerrrr!�__static_attributes__r#rrr
r
s;���18
�H�'��T�Y�Y�7�I�u�7�5�$8�N�M�8��rr
c�N^�\rSrSr%SrS\S'S\S'SrS\S	'S19\S'SrS
\S'S\S'S20\S'S\S'S(S)Sjjr0r	S\S'S\S'Sr21S*SjrS+Sjr\
S,Sj5rU4SjrSrS(SjrS r\S!5rS"rS#rS$rS%r\S-S&j5rS'rU=r$).�Flow�,z�22Base class for network flows. A flow is a collection of objects,23for example HTTP request/response pairs or a list of TCP messages.24 25See also:26 - mitmproxy.http.HTTPFlow27 - mitmproxy.tcp.TCPFlow28 - mitmproxy.udp.UDPFlow29�connection.Client�client_conn�connection.Server�server_connNzError | None�error�bool�intercepted�r�markedz30str | None�	is_replay�liver�timestamp_createdc��[[R"55UlXlX lX0l[R"5UlSUl	SUl31SUlSUlSUl
[5UlSUlg)NFr6)r�uuid�uuid4�idr0r2r9r*r:r5�
_resume_event�_backupr7r8�dict�metadata�comment)rr0r2r9s    r�__init__�
Flow.__init__psj���d�j�j�l�#���&��&���	�!%������!&���37���$(������%)���(,���
���rzdict[str, type[Flow]]�_Flow__typesr�typec��URRS5R5UlU[R32UR'g)Nr-)r$�removesuffix�lowerrGr-rF)�cls�kwargss  r�__init_subclass__�Flow.__init_subclass__�s3���<�<�,�,�V�4�:�:�<���!$����S�X�X�rc
�(�[RURURUR(aURR5OSURR5URR5URURUR[R"UR5URURS.nUR U:wa [R"UR 5OSUS'U$)N)r33rGr>r3r0r2r5r8r7rBrCr:�backup)r34�FLOW_FORMAT_VERSIONrGr>r3�	get_stater0r2r5r8r7�copy�deepcopyrBrCr:r@�r�states  rrR�Flow.get_state�s����2�2��I�I��'�'�/3�z�z�T�Z�Z�)�)�+�t��+�+�5�5�7��+�+�5�5�7��+�+�����k�k��
�
�d�m�m�4��|�|�!%�!7�!7�
35��:>����9N�$�-�-����5�TX��h���rc��URS5[R:XdeURS5UR:XdeURS5UlUS(afUR36(a+UR37R
URS55 O@[RURS55UlOURS5UlURR
URS55 URR
URS55 URS5UlURS5UlURS	5Ul
URS385UlURS5UlURS5UlURS
S5UlU0:Xdeg)Nr39rGr>r3r0r2r5r8r7rBrCr:rP)�popr40rQrGr>r3�	set_stater
�41from_stater0r2r5r8r7rBrCr:r@rUs  rrZ�Flow.set_state�sX���y�y��#�w�'B�'B�B�B�B��y�y�� �D�I�I�-�-�-��)�)�D�/�����>��z�z��42�43�$�$�U�Y�Y�w�%7�8�"�-�-�e�i�i��.@�A��44����7�+�D�J����"�"�5�9�9�]�#;�<����"�"�5�9�9�]�#;�<� �9�9�]�3������;�/����i�i��)����	�	�*�-��
��y�y��+���!&���+>�!?����y�y��4�0�����{��{rc���[RUSn[R45"SSS9n[R"SS9nU"X45nURU5 U$![a [SUS35ef=f)NrGzUnknown flow type: )r6r)�peername�sockname)�address)r-rF�KeyError�46ValueErrorr�Client�ServerrZ)rKrV�flow_cls�client�server�fs      rr[�Flow.from_state�s���	D��|�|�E�&�M�2�H��"�"�G�g�F���"�"�4�0���V�$��	���E�����
�	D��2�5��=�/�B�C�C�	D�s�A�A8c�2>�[TU]5nSUlU$)zMake a copy of this flow.F)�superrSr9)rrh�	__class__s  �rrS�	Flow.copy�s����G�L�N������rc�`�UR(aURUR5:g$g)zE47`True` if this file has been modified by a user, `False` otherwise.48F�r@rRrs r�modified�
Flow.modified�s$���<�<��<�<�4�>�>�#3�3�3�rc�R�UR(dUR5Ulgg)zO49Save a backup of this flow, which can be restored by calling `Flow.revert()`.50Nro)r�forces  rrP�Flow.backup�s���|�|��>�>�+�D�L�rc�l�UR(a#URUR5 SUlgg)z%51Revert to the last backed up state.52N)r@rZrs r�revert�Flow.revert�s'���<�<��N�N�4�<�<�(��D�L�rc��UR=(a? UR=(a' URR[R:H(+$)zB*Read-only:* `True` if this flow can be killed, `False` otherwise.)r9r3rr
rrs r�killable�
Flow.killable�s2���y�y�X�$�*�*�"W������5�CW�CW�1W�X�Xrc��UR(d[R"S5e[[R5UlSUlSUlg)zX53Kill this flow. The current request/response will not be forwarded to its destination.54zFlow is not killable.FN)ryr	�ControlExceptionr
rr3r5r9rs r�kill�	Flow.kill�s@���}�}��-�-�.E�F�F�55�5�/�/�0��56� �����	rc��UR(agSUlURbURR5 gg)zC57Intercept this Flow. Processing will stop until resume is58called.59NT)r5r?�clearrs r�	intercept�Flow.intercept�s;��60����������)����$�$�&�*rc���# �UR(dgURc[R"5UlURR	5IShv�N gN7f)z"61Wait until this Flow is resumed.62N)r5r?�asyncio�Event�waitrs r�wait_for_resume�Flow.wait_for_resume�sE����������%�!(����D��� � �%�%�'�'�'�s�AA!�A�A!c��UR(dgSUlURbURR5 gg)u963Continue with the flow – called after an intercept().64NF)r5r?�setrs r�resume�Flow.resume	s;������ ������)����"�"�$�*rc�.�URR$)z�65*Read-only:* Start time of the flow.66Depending on the flow type, this property is an alias for67`mitmproxy.connection.Client.timestamp_start` or `mitmproxy.http.Request.timestamp_start`.68)r0�timestamp_startrs rr��Flow.timestamp_starts�����/�/�/r)
r@r?r0rCr3r>r5r8r9r7rBr2r:)F)r0r/r2r1r9r4�return�None)r��serializable.State)rVr�r�r�)rVr�r�r-)r�r)r$r%r&r'r(r)r3r7rDrFrMrRrZ�classmethodr[rSrprPrv�propertyryr}r�r�r�r�r+�
__classcell__)rls@rr-r-,s0����#�"�1�"�"���E�<��=����69�F�C�������J��70����	�&��'���	�7172��(&(�G�
"�'���>�%��$�,�	��	���,� ��Y��Y��	'�(�%��0��0rr-)�73__future__rr�rSr*r<�dataclassesrr�typingrr�	mitmproxyrr	r74�mitmproxy.coretypesr�SerializableDataclassr
�Serializabler-�__all__r#rr�<module>r�sq��"�����!���� � ��,���L�.�.����2n0�<�$�$�n0�d���r
codekingpro/portable-devtools · Team Ai