Using TcpCatcher as a proxy with Basex Client

Monday, 13 October 2014 · 4 messages · last reply 20 Oct 2014
AV
Arto Viitanen13 Oct 2014 13:24 #
I am debugging a Basex client built in C#. The client is based on the Git Hub example https://github.com/BaseXdb/basex/tree/master/basex-api/src/main/c%23. The problem is, every now and then the client drops the session. It might be, that the client drops the connection if the server takes too much time to answer (or something). So I need some way to emulate slow connection or connection dropping packages. I downloaded TcpCatcher (http://www.tcpcatcher.org/) and set it as a proxy (client talks to 21984; TcpCatcher catches packages and send them to BaseX listening to 11984). But It seems that BaseX does not respond. I took BasexClient.cs and Example.cs from the github and tried with them. I get three packages; one coming from the server and two going to client; but after that nothing. The Example prints "Access Denied". I guess this comes from:
   socket = new TcpClient(host, port);
      stream = socket.GetStream();
      ehost = host;
      string ts = Receive();
      Send(username);
      Send(MD5(MD5(pw) + ts));
      if (stream.ReadByte() != 0)
      {
        throw new IOException("Access denied.");
      }
that is: client gets ts (timestamp?), sends username and password with timestamp; but receives nothing. So how can I use TcpCatcher (or other proxy program) with Basex client? (Basex 7.7; windows 7) Arto Viitanen Microteam Oy
CG
Christian Grün20 Oct 2014 00:22 #
Hi Arto, I have seen that you haven't got any feedback yet. I am sorry I have no experience with TcpCatcher or any other network monitor. Did you try at least one other tool? I remember some people use WireShark. Best, Christian
Quoted text · Arto Viitanen · 65 lines
On Mon, Oct 13, 2014 at 1:24 PM, Arto Viitanen <arto.viitanen at microteam.fi> wrote: > I am debugging a Basex client built in C#. The client is based on the Git > Hub example > https://github.com/BaseXdb/basex/tree/master/basex-api/src/main/c%23. The > problem is, every now and then the client drops the session. It might be, > that the client drops the connection if the server takes too much time to > answer (or something). So I need some way to emulate slow connection or > connection dropping packages. I downloaded TcpCatcher > (http://www.tcpcatcher.org/) and set it as a proxy (client talks to 21984; > TcpCatcher catches packages and send them to BaseX listening to 11984). But > It seems that BaseX does not respond. > > > > I took BasexClient.cs and Example.cs from the github and tried with them. I > get three packages; one coming from the server and two going to client; but > after that nothing. The Example prints “Access Denied”. > > > > I guess this comes from: > > > > socket = new TcpClient(host, port); > > stream = socket.GetStream(); > > ehost = host; > > string ts = Receive(); > > Send(username); > > Send(MD5(MD5(pw) + ts)); > > if (stream.ReadByte() != 0) > > { > > throw new IOException("Access denied."); > > } > > > > that is: client gets ts (timestamp?), sends username and password with > timestamp; but receives nothing. > > > > So how can I use TcpCatcher (or other proxy program) with Basex client? > > > > (Basex 7.7; windows 7) > > > > Arto Viitanen > > Microteam Oy > >
AV
Arto Viitanen20 Oct 2014 07:22 #
Thanks Christian for your suggestion. I have not tried WireShark, since it does not simulate slow network. It might help on showing what is problem on the communication as a whole, so I try it.
Quoted text · Christian Grün · 74 lines
-----Original Message----- From: Christian Grün [mailto:christian.gruen at gmail.com] Sent: 20. lokakuuta 2014 1:22 To: Arto Viitanen Cc: basex-talk at mailman.uni-konstanz.de Subject: Re: [basex-talk] Using TcpCatcher as a proxy with Basex Client Hi Arto, I have seen that you haven't got any feedback yet. I am sorry I have no experience with TcpCatcher or any other network monitor. Did you try at least one other tool? I remember some people use WireShark. Best, Christian On Mon, Oct 13, 2014 at 1:24 PM, Arto Viitanen <arto.viitanen at microteam.fi> wrote: > I am debugging a Basex client built in C#. The client is based on the > Git Hub example > https://github.com/BaseXdb/basex/tree/master/basex-api/src/main/c%23. > The problem is, every now and then the client drops the session. It > might be, that the client drops the connection if the server takes too > much time to answer (or something). So I need some way to emulate slow > connection or connection dropping packages. I downloaded TcpCatcher > (http://www.tcpcatcher.org/) and set it as a proxy (client talks to > 21984; TcpCatcher catches packages and send them to BaseX listening to > 11984). But It seems that BaseX does not respond. > > > > I took BasexClient.cs and Example.cs from the github and tried with > them. I get three packages; one coming from the server and two going > to client; but after that nothing. The Example prints “Access Denied”. > > > > I guess this comes from: > > > > socket = new TcpClient(host, port); > > stream = socket.GetStream(); > > ehost = host; > > string ts = Receive(); > > Send(username); > > Send(MD5(MD5(pw) + ts)); > > if (stream.ReadByte() != 0) > > { > > throw new IOException("Access denied."); > > } > > > > that is: client gets ts (timestamp?), sends username and password with > timestamp; but receives nothing. > > > > So how can I use TcpCatcher (or other proxy program) with Basex client? > > > > (Basex 7.7; windows 7) > > > > Arto Viitanen > > Microteam Oy > >
MG
Maximilian Gärber20 Oct 2014 08:59 #
Hi, on Windows your best (free) option is Fiddler http://www.telerik.com/fiddler Regards, Max 2014-10-20 7:22 GMT+02:00 Arto Viitanen <arto.viitanen at microteam.fi>:
Quoted text · Arto Viitanen · 82 lines
> Thanks Christian for your suggestion. I have not tried WireShark, since it does not simulate slow network. It might help on showing what is problem on the communication as a whole, so I try it. > > > -----Original Message----- > From: Christian Grün [mailto:christian.gruen at gmail.com] > Sent: 20. lokakuuta 2014 1:22 > To: Arto Viitanen > Cc: basex-talk at mailman.uni-konstanz.de > Subject: Re: [basex-talk] Using TcpCatcher as a proxy with Basex Client > > Hi Arto, > > I have seen that you haven't got any feedback yet. I am sorry I have no experience with TcpCatcher or any other network monitor. Did you try at least one other tool? I remember some people use WireShark. > > Best, > Christian > > > On Mon, Oct 13, 2014 at 1:24 PM, Arto Viitanen <arto.viitanen at microteam.fi> wrote: >> I am debugging a Basex client built in C#. The client is based on the >> Git Hub example >> https://github.com/BaseXdb/basex/tree/master/basex-api/src/main/c%23. >> The problem is, every now and then the client drops the session. It >> might be, that the client drops the connection if the server takes too >> much time to answer (or something). So I need some way to emulate slow >> connection or connection dropping packages. I downloaded TcpCatcher >> (http://www.tcpcatcher.org/) and set it as a proxy (client talks to >> 21984; TcpCatcher catches packages and send them to BaseX listening to >> 11984). But It seems that BaseX does not respond. >> >> >> >> I took BasexClient.cs and Example.cs from the github and tried with >> them. I get three packages; one coming from the server and two going >> to client; but after that nothing. The Example prints “Access Denied”. >> >> >> >> I guess this comes from: >> >> >> >> socket = new TcpClient(host, port); >> >> stream = socket.GetStream(); >> >> ehost = host; >> >> string ts = Receive(); >> >> Send(username); >> >> Send(MD5(MD5(pw) + ts)); >> >> if (stream.ReadByte() != 0) >> >> { >> >> throw new IOException("Access denied."); >> >> } >> >> >> >> that is: client gets ts (timestamp?), sends username and password with >> timestamp; but receives nothing. >> >> >> >> So how can I use TcpCatcher (or other proxy program) with Basex client? >> >> >> >> (Basex 7.7; windows 7) >> >> >> >> Arto Viitanen >> >> Microteam Oy >> >>

⚡Generated with XQuery