icmdline.txt - gopher-tutorials - The gopher tutorials project. Err bitreich.org 70 hgit clone git://bitreich.org/gopher-tutorials/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/gopher-tutorials/ URL:git://bitreich.org/gopher-tutorials/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/gopher-tutorials/ bitreich.org 70 1Log /scm/gopher-tutorials/log.gph bitreich.org 70 1Files /scm/gopher-tutorials/files.gph bitreich.org 70 1Refs /scm/gopher-tutorials/refs.gph bitreich.org 70 1Tags /scm/gopher-tutorials/tag bitreich.org 70 i--- Err bitreich.org 70 icmdline.txt (1704B) Err bitreich.org 70 i--- Err bitreich.org 70 i 1 Dear reader, in this document we will see differents command line Err bitreich.org 70 i 2 software which can be used to connect to a gopher server. Err bitreich.org 70 i 3 Err bitreich.org 70 i 4 Err bitreich.org 70 i 5 Printf + netcat Err bitreich.org 70 i 6 =============== Err bitreich.org 70 i 7 Err bitreich.org 70 i 8 It's possible to write request "by hand" using printf to format the Err bitreich.org 70 i 9 request string and then netcat to send it to the remote server. Err bitreich.org 70 i 10 Err bitreich.org 70 i 11 A request of the file "/tutorials/cmdline.txt" will looks like this : Err bitreich.org 70 i 12 Err bitreich.org 70 i 13 printf "/tutorials/cmdline.txt\r\n" | nc somedomain.com 70 Err bitreich.org 70 i 14 Err bitreich.org 70 i 15 You will get the server answer directly into your output. Be careful Err bitreich.org 70 i 16 if you ask binary files, it will be displayed on your screen, this is Err bitreich.org 70 i 17 not something a regular user want. If you want to download a binary Err bitreich.org 70 i 18 file, you can redirect the output to a file using ">" or pipe it to Err bitreich.org 70 i 19 another software (or using tee for both at the same time). Err bitreich.org 70 i 20 Err bitreich.org 70 i 21 The following example will download a music file, save it on the Err bitreich.org 70 i 22 filesystem and play it with mpv while downloading. Err bitreich.org 70 i 23 Err bitreich.org 70 i 24 printf "/some_music.ogg\r\n" | nc somedomain.com 70 \ Err bitreich.org 70 i 25 | tee saved_music.ogg | mpv - Err bitreich.org 70 i 26 Err bitreich.org 70 i 27 You may have seen that the data type is not part of the request Err bitreich.org 70 i 28 string, this is because it is only useful for the client to decide how Err bitreich.org 70 i 29 to handle the content. In the current case, the client is YOU, so if Err bitreich.org 70 i 30 you ask a menu and you want to download a file which has been tagged Err bitreich.org 70 i 31 with type "I" then you should use the right process to deal with an Err bitreich.org 70 i 32 image file. Err bitreich.org 70 i 33 Err bitreich.org 70 i 34 Err bitreich.org 70 i 35 Curl Err bitreich.org 70 i 36 ==== Err bitreich.org 70 i 37 Err bitreich.org 70 i 38 It is possible to use curl to connect to a gopher server, most of its Err bitreich.org 70 i 39 options are supported, like timeout or traffic shaping. You need to Err bitreich.org 70 i 40 pass a full url with "gopher://" at the start to curl to tell it you Err bitreich.org 70 i 41 want to request a gopher server. Err bitreich.org 70 i 42 Err bitreich.org 70 i 43 By default, curl will output the server result to stdout. Explanations Err bitreich.org 70 i 44 can be found in the previous section about this. Err bitreich.org 70 i 45 Err bitreich.org 70 .