Skip to content

imor/pgroxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A proxy to sniff postgres wire protocol traffic.

pgroxy sits between a client and a postgres server. It copies data between the client and the server while decoding the passing protocol packets and dumping them on stdout.

+--------+       +--------+        +----------+
| client | <---> | pgroxy |  <---> | postgres |
+--------+       +--------+        +----------+
                     |
                     V
                 +--------+
                 | stdout |
                 +--------+

Getting Started

pgroxy needs both a listen address and an upstream address. E.g. to listen on port 8080 and connect to a postgres server at 5432 run the following:

cargo run -- --listen localhost:8080 --connect localhost:5432

With this pgroxy will start listening on localhost:8080. Now connect your Postgres client to localhost:8080 instead of localhost:5432 to observe the Postgres wire protocol messages.

Supported Messages

(from https://www.postgresql.org/docs/current/protocol-message-formats.html):

  • AuthenticationOk
  • AuthenticationKerberosV5
  • AuthenticationCleartextPassword
  • AuthenticationMD5Password
  • AuthenticationGSS
  • AuthenticationGSSContinue
  • AuthenticationSSPI
  • AuthenticationSASL
  • AuthenticationSASLContinue
  • AuthenticationSASLFinal
  • BackendKeyData
  • Bind
  • BindComplete
  • CancelRequest
  • Close
  • CloseComplete
  • CommandComplete
  • CopyData
  • CopyDone
  • CopyFail
  • CopyInResponse
  • CopyOutResponse
  • CopyBothResponse
  • DataRow
  • Describe
  • EmptyQueryResponse
  • ErrorResponse
  • Execute
  • Flush
  • FunctionCall
  • FunctionCallResponse
  • GSSENCRequest
  • GSSResponse
  • NegotiateProtocolVersion
  • NoData
  • NoticeResponse
  • NotificationResponse
  • ParameterDescription
  • ParameterStatus
  • Parse
  • ParseComplete
  • PasswordMessage
  • PortalSuspended
  • Query
  • ReadyForQuery
  • RowDescription
  • SASLInitialResponse
  • SASLResponse
  • SSLRequest
  • StartupMessage
  • Sync
  • Terminate

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages