main :: IO ()
main = do 
  configFilePath <- execParser options
  MITM.withConfigFile configFilePath $ \config -> do
    let backends = MITM.cfgBackendAddress config
        log_filepath = MITM.cfgLogFilePath config
    fileLoggerSet <- LOG.newFileLoggerSet LOG.defaultBufSize log_filepath
    requestLogger <- Wai.mkRequestLogger def
    Warp.run 8000 (requestLogger (MITM.teeProxy backends fileLoggerSet))
  where 
    parser = strOption (
         long "config"
      <> noArgError ShowHelpText
      <> metavar "CONFIG"
      <> value "config/mitmproxy.yaml"
      <> help "configuration filepath"
      )
    options = info parser (fullDesc <> progDesc "http-multiplexer: http request mutiplexer")
main :: IO ()
main = do 
  configFilePath <- execParser options
  MITM.withConfigFile configFilePath $ \config -> do
    let backends = MITM.cfgBackendAddress config
        log_filepath = MITM.cfgLogFilePath config
    fileLoggerSet <- LOG.newFileLoggerSet LOG.defaultBufSize log_filepath
    requestLogger <- Wai.mkRequestLogger def
    Warp.run 8000 (requestLogger (MITM.teeProxy backends fileLoggerSet))
  where 
    parser = strOption (
         long "config"
      <> noArgError ShowHelpText
      <> metavar "CONFIG"
      <> value "config/mitmproxy.yaml"
      <> help "configuration filepath"
      )
    options = info parser (fullDesc <> progDesc "http-multiplexer: http request mutiplexer")
main = do 
  configFilePath <- execParser options
  MITM.withConfigFile configFilePath $ \config -> do
    let backends = MITM.cfgBackendAddress config
        log_filepath = MITM.cfgLogFilePath config
    fileLoggerSet <- LOG.newFileLoggerSet LOG.defaultBufSize log_filepath
    requestLogger <- Wai.mkRequestLogger def
    Warp.run 8000 (requestLogger (MITM.teeProxy backends fileLoggerSet))
  where 
    parser = strOption (
         long "config"
      <> noArgError ShowHelpText
      <> metavar "CONFIG"
      <> value "config/mitmproxy.yaml"
      <> help "configuration filepath"
      )
    options = info parser (fullDesc <> progDesc "http-multiplexer: http request mutiplexer")