-1

I am an avid Go player and play on the Kiseido Go Server.

I would like to write an open source client for this, but the KGS protocol is a well-kept secret. Is there any way to catch the http requests made by the *.jar file to the Go server?

I know this is possible because at least one other client app (CGoban) exists.

  • 1
    For capturing HTTP traffic, you can't beat telerik.com/fiddler – Mawg Jan 28 '15 at 12:37
  • 1
    You can also try decompiling the jar file to try and understand how this network communication is occurring. – maple_shaft Jan 28 '15 at 14:26
3

You've got two basic approaches, one is to watch the network traffic, the other is to look at the source.

For looking at the source, you would do something like use a java decompiler and see what it gives you. Note, however that this means you are looking at the source (or something close to it) and any works based on it may be considered a derived work (in which case you may not be allowed to release it with your desired license - or at all).

The other option would be to sniff the traffic somehow. Depending on one's familiarity with network administration, there is the option of setting up a transparent web caching proxy that would allow you to watch what goes through it. Or a specific application like fiddler to sniff the traffic.

There is nothing saying that this is running over port 80. It could be running on port 1502 with something other than http. For that you would need to look at sniffing all the packets to get a better idea of what is going on. For that you start looking at tools such as wireshark or tcpdump. Then you look at all the packets and figure out what it is doing.

Reverse engineering a protocol that may be obscufated is not necessarily trivial. Especially if you don't have a server of your own that you can test against (you will be testing to see if it does the right thing on the other end). A tweak to the protocol (I note that they use java webstart - it would be very easy) and all your work has to start over again. If you don't "behave" it could be fairly trivial to start blocking the IP of misbehaving clients.

This leads us to another option which the site provides. There is a GTP client also listed on the client page. This is a translation layer between the Go Text Protocal and KGS. You could write a program that writes GTP through standard in and out and is piped through the client.

This way you are using their library at arms length (you could switch it to another server that provides their own GTP client trivially) and create your own open source application that serves an even wider community. This is exactly what GNU Go does:

Although ASCII-based, GNU Go supports two protocols — the Go Modem Protocol and the Go Text Protocol — by which GUIs can interface with it to give a graphical display. Several such GUIs exist. GTP also allows it to play online on Go servers (through the use of bridge programs), and copies can be found running on NNGS, KGS, and probably others.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.