Files
Trancribe/venv/lib/python3.12/site-packages/websockets/__pycache__/http11.cpython-312.pyc

169 lines
15 KiB
Plaintext
Raw Normal View History

<EFBFBD>
$n!j=<00><01><><00>ddlmZddlZddlZddlZddlZddlZddlmZddl m
Z
ddl m Z ddl mZddlmZgd <09>Zd
j$ej&<00>Zej*j-d d e<14>d e<10><00><04>Zej*j-dd e<14>d e<10><00><04>Zeej*j-dd<10><00>Zeej*j-dd<12><00>Zeej*j-dd<14><00>Zdd<15>Zej<d<16>Zej<d<17>Z ejBGd<18>d<19><00>Z"ejBGd<1A>d<1B><00>Z# d d<1C>Z$ d!d<1D>Z% d"d<1E>Z&y)#<23>)<01> annotationsN)<01> Generator)<01>Callable<6C>)<01>Headers)<01> SecurityError)<01>version)<04>SERVER<45>
USER_AGENT<EFBFBD>Request<73>Responsez{}.{}<7D>WEBSOCKETS_USER_AGENTzPython/z websockets/<2F>WEBSOCKETS_SERVER<45>WEBSOCKETS_MAX_NUM_HEADERS<52>128<32>WEBSOCKETS_MAX_LINE_LENGTH<54>8192<39>WEBSOCKETS_MAX_BODY_SIZE<5A> 1_048_576c<01>&<00>|jd<01><02>S)zG
Decode a bytestring for interpolating into an error message.
<20>backslashreplace<63><01>errors)<01>decode)<01>values <20>S/home/jean/linux-transcriber/venv/lib/python3.12/site-packages/websockets/http11.py<70>dr2s<00><00>
<11><<3C><<3C>1<><<3C> 2<>2<>s[-!#$%&\'*+.^_`|~0-9a-zA-Z]+s[\x09\x20-\x7e\x80-\xff]*c<01>h<00>eZdZUdZded<ded<dZded<ed d <09><04>Ze d d
<EFBFBD><04>Z dd <0B>Z
y)r z<>
WebSocket handshake request.
Attributes:
path: Request path, including optional query.
headers: Request headers.
<20>str<74>pathr<00>headersN<73>Exception | None<6E>
_exceptionc<01>N<00>tjdt<00>|jS)NzIRequest.exception is deprecated; use ServerProtocol.handshake_exc instead<61><04>warnings<67>warn<72>DeprecationWarningr$<00><01>selfs r<00> exceptionzRequest.exception^s <00><00><10> <0A> <0A> W<> <1E>
<EFBFBD><14><EFBFBD><EFBFBD>rc#<01>K<00> t|<01>Ed{<00><03><02>} |jdd<04>\}}}|dk7rtdt |<02><00><00><02><00>|dk7rtd t |<04><00><00><02><00>|j d
d <0B>}t |<01>Ed{<00><02><02>}d |vr td <0A><00>d|vrt|d<00>dk7r td<10><00>|||<08>S7<00><>#t$r}td<02>|<03>d}~wwxYw#t$rtdt |<02><00><00><02>d<01>wxYw7<00><><EFBFBD>w)a<>
Parse a WebSocket handshake request.
This is a generator-based coroutine.
The request path isn't URL-decoded or validated in any way.
The request path and headers are expected to contain only ASCII
characters. Other characters are represented with surrogate escapes.
:meth:`parse` doesn't attempt to read the request body because
WebSocket handshake requests don't have one. If the request contains a
body, it may be read from the data stream after :meth:`parse` returns.
Args:
read_line: Generator-based coroutine that reads a LF-terminated
line or raises an exception if there isn't enough data
Raises:
EOFError: If the connection is closed without a full HTTP request.
SecurityError: If the request exceeds a security limit.
ValueError: If the request isn't well formatted.
Nz1connection closed while reading HTTP request line<6E> <20>zinvalid HTTP request line: <20>HTTP/1.1<EFBFBD>)unsupported protocol; expected HTTP/1.1: sGETz+unsupported HTTP method; expected GET; got <20>ascii<69>surrogateescape<70>Transfer-Encodingz!transfer codings aren't supported<65>Content-Lengthrzunsupported request body) <09>
parse_line<EFBFBD>EOFError<6F>split<69>
ValueErrorrr<00> parse_headers<72>NotImplementedError<6F>int) <09>cls<6C> read_line<6E> request_line<6E>exc<78>method<6F>raw_path<74>protocolr!r"s r<00>parsez Request.parsefsB<00><00><><00>F Y<01>&0<><19>&;<3B>;<3B>L<EFBFBD> X<01>)5<>);<3B>);<3B>D<EFBFBD>!<21>)D<> &<26>F<EFBFBD>H<EFBFBD>h<EFBFBD> <14>{<7B> "<22><1C>;<3B>A<EFBFBD>l<EFBFBD>O<EFBFBD>;L<>M<><0E> <0E> <12>V<EFBFBD> <1B><1C>J<>1<EFBFBD>V<EFBFBD>9<EFBFBD>+<2B>V<>W<> W<><17><EFBFBD><EFBFBD>w<EFBFBD>(9<>:<3A><04>*<2A>9<EFBFBD>5<>5<><07> <1F>'<27> )<29>%<25>&I<>J<> J<> <1B>w<EFBFBD> &<26><13>7<EFBFBD>+<2B>,<2C>-<2D><11>2<> <20>!;<3B><<3C><<3C><12>4<EFBFBD><17>!<21>!<21>;<<3C><><17> Y<01><1A>N<>O<>UX<55> X<><58> Y<01><>
<1A> X<01><1C>:<3A>1<EFBFBD>\<5C>?<3F>:K<>L<>M<>SW<53> W<> X<01><>6<>sU<00>D <01>C<00>C<04>C<00>C"<00>AD <01>D<04><D <01>C<00> C<03> C<03>C<03>D <01>""D<03>D c<01>|<00>d|j<00>d<02>j<00>}||jj<00>z }|S)z;
Serialize a WebSocket handshake request.
zGET z HTTP/1.1
)r!<00>encoder"<00> serialize)r+<00>requests rrGzRequest.serialize<7A>s;<00><00><19><14><19><19> <0B>=<3D>1<>8<>8<>:<3A><07><0F>4<EFBFBD><<3C><<3C>)<29>)<29>+<2B>+<2B><07><16>r<00><02>returnr#)r><00>9Callable[[int], Generator[None, None, bytes | bytearray]]rJzGenerator[None, None, Request]<5D>rJ<00>bytes) <0B>__name__<5F>
__module__<EFBFBD> __qualname__<5F>__doc__<5F>__annotations__r$<00>propertyr,<00> classmethodrDrG<00>rrr r Nsc<00><00><08> <0E>I<EFBFBD> <14><14>$(<28>J<EFBFBD> <20>'<27> <0A><1F><0E><1F><11>@"<22>L<>@"<22>
(<28>@"<22><11>@"<22>D rr c<01><><00>eZdZUdZded<ded<ded<dZd ed
<d Zd ed <edd<0E><04>Ze d dd<0F><05>Z
dd<10>Z y )r z<>
WebSocket handshake response.
Attributes:
status_code: Response code.
reason_phrase: Response reason.
headers: Response headers.
body: Response body.
r<<00> status_coder <00> reason_phraserr"r<00>bytes | bytearray<61>bodyNr#r$c<01>N<00>tjdt<00>|jS)NzJResponse.exception is deprecated; use ClientProtocol.handshake_exc insteadr&r*s rr,zResponse.exception<6F>s"<00><00><10> <0A> <0A> 7<> <1E>
<EFBFBD>
<14><EFBFBD><EFBFBD>rc#<01><>K<00> t|<01>Ed{<00><03><02>} |jdd<04>\}}} |r|dvr3tdt |<05><00><00><02><00>|dk7rtd t |<05><00><00><02><00> t |<08>}
d |
cxkrd ksntd t |<08><00><00><02><00>t j| <09>stdt | <09><00><00><02><00>| jdd<10>} t|<01>Ed{<00><02><02>} |rd} nt|
| |||<03>Ed{<00><02><02>} ||
| | | <0A>S7<00><>#t$r}td<02>|<06>d}~wwxYw#t$rtdt |<05><00><00><02>d<01>wxYw#t$rtd
t |<08><00><00><02>d<01>wxYw7<00><>7<00>z<EFBFBD>w)a<>
Parse a WebSocket handshake response.
This is a generator-based coroutine.
The reason phrase and headers are expected to contain only ASCII
characters. Other characters are represented with surrogate escapes.
Args:
read_line: Generator-based coroutine that reads a LF-terminated
line or raises an exception if there isn't enough data.
read_exact: Generator-based coroutine that reads the requested
bytes or raises an exception if there isn't enough data.
read_to_eof: Generator-based coroutine that reads until the end
of the stream.
Raises:
EOFError: If the connection is closed without a full HTTP response.
SecurityError: If the response exceeds a security limit.
LookupError: If the response isn't well formatted.
ValueError: If the response isn't well formatted.
Nz0connection closed while reading HTTP status liner.r/zinvalid HTTP status line: )r0sHTTP/1.0z5unsupported protocol; expected HTTP/1.1 or HTTP/1.0: r0r1z+invalid status code; expected integer; got <20>diXu-invalid status code; expected 100599; got zinvalid HTTP reason phrase: r2r3r) r6r7r8r9rr<<00> _value_re<72> fullmatchrr:<00> read_body)r=r><00>
read_exact<EFBFBD> read_to_eof<6F>proxy<78> status_liner@rC<00>raw_status_code<64>
raw_reasonrW<00>reasonr"rZs rrDzResponse.parse<73>s<><00><00><><00>B X<01>%/<2F> <09>%:<3A>:<3A>K<EFBFBD> V<01>4?<3F>4E<34>4E<34>d<EFBFBD>A<EFBFBD>4N<34> 1<>H<EFBFBD>o<EFBFBD>z<EFBFBD> <11><17>9<>9<> <20>K<><18><1B>~<7E>&<26>(<28><12><12>
<18>;<3B>&<26> <20>?<3F><01>+<2B><0E>?O<>P<><12><12> <18><1D>o<EFBFBD>.<2E>K<EFBFBD>
<13>k<EFBFBD>'<27>C<EFBFBD>'<27><1C>?<3F><01>/<2F>@R<>?S<>T<><0E> <0E><19>"<22>"<22>:<3A>.<2E><1C>;<3B>A<EFBFBD>j<EFBFBD>M<EFBFBD>?<3F>K<>L<> L<><1B>"<22>"<22>7<EFBFBD>,=<3D>><3E><06>*<2A>9<EFBFBD>5<>5<><07> <11><16>D<EFBFBD>'<27><1B>W<EFBFBD>i<EFBFBD><1A>[<5B><0E><0E>D<EFBFBD><13>;<3B><06><07><14>6<>6<>W;<3B><><17> X<01><1A>M<>N<>TW<54> W<><57> X<01><>
<1A> V<01><1C>9<>!<21>K<EFBFBD>.<2E>9I<39>J<>K<>QU<51> U<> V<01><><1A> <18><1C>=<3D>a<EFBFBD><0F>>P<>=Q<>R<><0E><17> <18> <18><>6<><36> <0E>s<00>E<<01>D<00>D<04>D<00>D.<00>9E<<01>( E<00>3A0E<<01>#E8<04>$E<<01>?E:<04>E<<01>D<00> D+<03> D&<03>&D+<03>+E<<01>."E<03>E<<01>"E5<03>5E<<01>:E<c<01><><00>d|j<00>d|j<00>d<03>j<00>}||jj <00>z }||j
z }|S)z<
Serialize a WebSocket handshake response.
z HTTP/1.1 <20> z
)rWrXrFr"rGrZ)r+<00>responses rrGzResponse.serialize!sY<00><00><1F>t<EFBFBD>/<2F>/<2F>0<><01>$<24>2D<32>2D<32>1E<31>T<EFBFBD>J<>Q<>Q<>S<><08><10>D<EFBFBD>L<EFBFBD>L<EFBFBD>*<2A>*<2A>,<2C>,<2C><08><10>D<EFBFBD>I<EFBFBD>I<EFBFBD><1D><08><17>rrI)F)
r>rKrarKrbrKrc<00>boolrJzGenerator[None, None, Response]rL) rNrOrPrQrRrZr$rSr,rTrDrGrUrrr r <00>s<><00><00> <08><15><14><16><16> <14><14>!<21>D<EFBFBD>
<1B>!<21>#'<27>J<EFBFBD> <20>'<27> <0A><1F><0E><1F><11> <1C> L7<>L<>L7<>N<01>L7<>O<01> L7<>
<14> L7<>
)<29> L7<><11>L7<>\
rr c#<01><>K<00> |t<00>Ed{<00><03><02>}|jd<03>s t d<04><00>|ddS7<00>%#t$r td<02><00>wxYw<01>w)ao
Parse a single line.
CRLF is stripped from the return value.
Args:
read_line: Generator-based coroutine that reads a LF-terminated line
or raises an exception if there isn't enough data.
Raises:
EOFError: If the connection is closed without a CRLF.
SecurityError: If the response exceeds a security limit.
Nz line too long<6E>
zline without CRLF<4C><46><EFBFBD><EFBFBD><EFBFBD>)<05>MAX_LINE_LENGTH<54> RuntimeErrorr<00>endswithr7)r><00>lines rr6r6.s\<00><00><><00>"-<2D>#<23>O<EFBFBD>4<>4<><04> <10>=<3D>=<3D><17> !<21><16>*<2A>+<2B>+<2B> <0F><03><12>9<EFBFBD><14> 5<><35> <17>-<2D><1B>O<EFBFBD>,<2C>,<2C>-<2D>s%<00>A<01>;<00>9<04>;<00>!A<01>;<00>A<03>Ac#<01>pK<00>t<00>}ttdz<00>D]<5D>} t|<00>Ed{<00><03><02>}|dk(r|S |j dd<01>\}}tj|<05>st dt|<05><00><00><02><00>|jd<08>}tj|<06>st d t|<06><00><00><02><00>|jd
<EFBFBD>}|jd
d <0B>}|||<<00><>td <0C><00>7<00><>#t$r}t d<03>|<04>d}~wwxYw#t $rt dt|<03><00><00><02>d<02>wxYw<01>w) a<>
Parse HTTP headers.
Non-ASCII characters are represented with surrogate escapes.
Args:
read_line: Generator-based coroutine that reads a LF-terminated line
or raises an exception if there isn't enough data.
Raises:
EOFError: If the connection is closed without complete headers.
SecurityError: If the request exceeds a security limit.
ValueError: If the request isn't well formatted.
rNz,connection closed while reading HTTP headersr<00>:zinvalid HTTP header line: zinvalid HTTP header name: s zinvalid HTTP header value: r2r3ztoo many HTTP headers)r<00>range<67>MAX_NUM_HEADERSr6r7r8r9r<00> _token_rer_<00>stripr^rr) r>r"<00>_rrr@<00>raw_name<6D> raw_value<75>namers rr:r:IsK<00><00><><00>,<16>i<EFBFBD>G<EFBFBD> <12>?<3F>Q<EFBFBD>&<26> '<27>5<><01> T<01>(<28><19>3<>3<>D<EFBFBD> <10>3<EFBFBD>;<3B> <11>& <13>N<EFBFBD># O<01>"&<26>*<2A>*<2A>T<EFBFBD>1<EFBFBD>"5<> <1F>H<EFBFBD>i<EFBFBD><19>"<22>"<22>8<EFBFBD>,<2C><1C>9<>!<21>H<EFBFBD>+<2B><1D>G<>H<> H<><1D>O<EFBFBD>O<EFBFBD>F<EFBFBD>+<2B> <09><18>"<22>"<22>9<EFBFBD>-<2D><1C>:<3A>1<EFBFBD>Y<EFBFBD><<3C>.<2E>I<>J<> J<><17><EFBFBD><EFBFBD>w<EFBFBD>'<27><04><19> <20> <20><17>*;<3B><<3C><05><1D><07><04> <0A>)5<>.<1C>3<>4<>4<>+4<><34><17> T<01><1A>I<>J<>PS<50> S<><53> T<01><><1A> O<01><1C>9<>!<21>D<EFBFBD>'<27><19>C<>D<>$<24> N<> O<01>sO<00> D6<01>C4<02>C2<06>C4<02>D6<01>D<02>BD6<01>2C4<02>4 D<05>= D <05> D<05>D6<01>"D3<05>3D6c#<01><>K<00>d|cxkrdks n|dk(s|dk(ry|jd<06>x}<05><>|dk7rtd|<05>d <09><03><00>d} t|<02>Ed{<00><02><02>}|jd
d <0B>d }t |<08>d kDr!|j d<0E><0F>} t d| <09>d<11><03><00>t|d<12>}
|
d k(rnbt |<06>|
ztkDrt d|
<EFBFBD>dt |<06><00>d<11><05><00>|||
<EFBFBD>Ed{<00><02><02>z }|d<15>Ed{<00><02><02>dk7r td<17><00><01><>t|<02>Ed{<00><02><02>|S|jd<18>x} <0B>Pt | <0B>dkDrt d| <0B>d<11><03><00>t| <0B>} | tkDrt d| <0C>d<11><03><00>|| <0C>Ed{<00><02><02>S |t<00>Ed{<00><03><02>S7<00><01>J7<00><>7<00><>7<00><>7<00>"7<00>#t$rt dt<00>d<11><03><00>wxYw<01>w)Nr]<00><><00><>i0rr4<00>chunkedztransfer coding z isn't supported<65>;rr<00>rrzchunk too large: 0xz bytes<65>zchunk too large: z bytes after r/rmzchunk without CRLFr5<00>zbody too large: zbody too large: over ) <0C>getr;r6r8<00>lenrrr<<00> MAX_BODY_SIZEr9r:rp) rWr"r>rarb<00>codingrZ<00>chunk_size_line<6E>raw_chunk_size<7A>str_chunk_size<7A>
chunk_size<EFBFBD>raw_content_length<74>content_lengths rr`r`|s<00><00><><00> <0B>k<EFBFBD><1F>C<EFBFBD><1F>;<3B>#<23>#5<><1B><03>9K<39><12><1C>K<EFBFBD>K<EFBFBD> 3<>4<>
4<EFBFBD>&<26> A<> <11>Y<EFBFBD> <1E>%<25>(8<><16><08>@P<>&Q<>R<> R<><12><04><12>)3<>I<EFBFBD>)><3E>><3E>O<EFBFBD>,<2C>2<>2<>4<EFBFBD><11>;<3B>A<EFBFBD>><3E>N<EFBFBD><12>><3E>"<22>R<EFBFBD>'<27>!/<2F>!6<>!6<>>P<>!6<>!Q<><0E>#<23>&9<>.<2E>9I<39><16>$P<>Q<>Q<><1C>^<5E>R<EFBFBD>0<>J<EFBFBD><19>Q<EFBFBD><EFBFBD><15><12>4<EFBFBD>y<EFBFBD>:<3A>%<25> <0A>5<>#<23>'<27>
<EFBFBD>|<7C>=<3D><13>T<EFBFBD><19> <0B>6<EFBFBD>R<><12><12> <11>z<EFBFBD>*<2A>5<>5<> 5<>D<EFBFBD>%<25>a<EFBFBD>=<3D>(<28>W<EFBFBD>4<> <20>!5<>6<>6<>!<13>$!<21><19>+<2B>+<2B>+<2B><13> <0B> '<27> <0B> <0B>,<<3C> =<3D>
=<3D>
<1C> J<> <0E>!<21> "<22>R<EFBFBD> '<27><1F>"2<>3E<33>2F<32>f<EFBFBD> M<>N<> N<><1C>/<2F>0<><0E> <19>M<EFBFBD> )<29><1F>"2<>><3E>2B<32>&<26> I<>J<> J<>%<25>n<EFBFBD>5<>5<>6<> O<01>*<2A>=<3D>9<>9<> :<3A>??<3F><>6<><36>(<28><> ,<2C><>6<><36>:<3A><><1B> O<01><1F>"7<> <0A><EFBFBD>f<EFBFBD> M<>N<> N<> O<01>s<EFBFBD><00>AG
<01>F<04>BG
<01>*F <06>+G
<01><F"<04>=!G
<01>F$<04>A$G
<01>F&<04>G
<01> F*<00>F(<04>F*<00>G
<01> G
<01>"G
<01>$G
<01>&G
<01>(F*<00>*G<03>G
)rrYrJr )r>rKrJ<00>(Generator[None, None, bytes | bytearray])r>rKrJzGenerator[None, None, Headers]) rWr<r"rr>rKrarKrbrKrJr<>)'<27>
__future__r<00> dataclasses<65>os<6F>re<72>sysr'<00>collections.abcr<00>typingr<00>datastructuresr<00>
exceptionsrr <00>websockets_version<6F>__all__<5F>format<61> version_info<66>PYTHON_VERSION<4F>environr<6E>r r
r<rvror<>r<00>compilerwr^<00> dataclassr r r6r:r`rUrr<00><module>r<>s<><00><01>"<22><12> <09> <09>
<EFBFBD><0F>%<25><1B>#<23>%<25>2<> <02><07> <20><17><1E><1E><13>!1<>!1<>2<><0E><10>Z<EFBFBD>Z<EFBFBD>^<5E>^<5E><1B> <0A>n<EFBFBD> <1D>\<5C>*<<3C>)=<3D>><3E><02>
<EFBFBD>
<0C><1A><1A><1E><1E><17> <0A>n<EFBFBD> <1D>\<5C>*<<3C>)=<3D>><3E>
<02><06> <16>b<EFBFBD>j<EFBFBD>j<EFBFBD>n<EFBFBD>n<EFBFBD>%A<>5<EFBFBD>I<>J<><0F><16>b<EFBFBD>j<EFBFBD>j<EFBFBD>n<EFBFBD>n<EFBFBD>%A<>6<EFBFBD>J<>K<><0F><14>B<EFBFBD>J<EFBFBD>J<EFBFBD>N<EFBFBD>N<EFBFBD>#=<3D>{<7B>K<>L<> <0A>3<> <17>B<EFBFBD>J<EFBFBD>J<EFBFBD>7<> 8<> <09> <17>B<EFBFBD>J<EFBFBD>J<EFBFBD>4<> 5<> <09> <0A><16><16>c<17>c<17><17>c<17>L <0A><16><16>u<18>u<18><17>u<18>p<15>H<><15>-<2D><15>60<13>H<>0<13>#<23>0<13>f:O<01><14>:O<01> <14>:O<01>I<01>:O<01>J<01> :O<01>
K<01> :O<01> .<2E> :Or