mirror of https://gogs.blitter.com/RLabs/xs
Update page 'Connection Protocol'
parent
d52759a0f4
commit
f160831188
|
@ -4,6 +4,60 @@ Connection Protocol
|
|||
![Connection Sequence Diagram (Simplified)](https://gogs.blitter.com/RLabs/hkexsh/raw/master/hkexsh/hkexsh_seq.png)
|
||||
|
||||
|
||||
Sequence Diagram Source Code (rendering above diagram via [websequencediagrams.com](https://www.websequencediagrams.com/))
|
||||
```
|
||||
title HKExSh Connection Sequence
|
||||
participant "User (shell)" as L
|
||||
participant "User (shell)" as L
|
||||
participant Client as C
|
||||
participant "HKExNet Lib" as HL
|
||||
participant "Go pkg/net" as NL
|
||||
participant "Server Listener" as SL
|
||||
participant Server as S
|
||||
|
||||
S-->+S: Listen()
|
||||
L-->+C: <<invoke client>>
|
||||
C->HL: Dial(prot, ipport, KExAlg, CAlg, HAlg)
|
||||
HL->NL: Dial(prot, ipport)
|
||||
NL->S:
|
||||
S-->+SL: Accept()
|
||||
SL->NL:
|
||||
NL->HL: c := net.Conn{}
|
||||
HL-->HL: hc := new hkexnet.Conn{c}
|
||||
note over HL: hc.cipheropts\n= (CAlg, HAlg)
|
||||
HL-->HL: hc.<KExAlg>DialSetup(c)
|
||||
|
||||
HL->C: conn = hc
|
||||
|
||||
#Client reads password from user
|
||||
C-->C: ReadPassword()
|
||||
C-->C: r := NewSession(op, uname,\nremHost, env, cmdStr, auth)
|
||||
par KEx
|
||||
#activate C
|
||||
C->SL: sendSessionParams(conn, r)
|
||||
activate SL
|
||||
SL->C:
|
||||
SL-->SL: auth(Client)
|
||||
SL->C: conn.Read(authReply)
|
||||
end
|
||||
C-->+C: doShellMode()
|
||||
par Encrypted
|
||||
C<->SL: r.Status := doShellMode(conn) / doCopyMode(conn)\n... (session) ...
|
||||
# ...
|
||||
# ...
|
||||
|
||||
C-->SL: <<EOF/logout>>
|
||||
end
|
||||
SL-->C: <<Disconnect>>
|
||||
deactivate SL
|
||||
|
||||
deactivate C
|
||||
C-->L: shell r.Status
|
||||
deactivate C
|
||||
C-->L: shell r.Status
|
||||
```
|
||||
|
||||
|
||||
```
|
||||
Session: [ Op byte | Who []byte | ConnHost []byte | TermType []byte | Cmd []byte | AuthCookie []byte ]
|
||||
|
||||
|
|
Loading…
Reference in New Issue