Use @libdir@ instead of @prefix@/lib
[gnome.seed] / examples / Gnio.js
1 #!/usr/bin/env seed
2 Gio = imports.gi.Gio;
3 Gnio = imports.gi.Gnio;
4
5 r = new Gnio.Resolver();
6
7 address = r.lookup_name("www.google.com");
8 saddr = new Gnio.InetSocketAddress({address: address, port: 80});
9 client = new Gnio.SocketConnection({address: saddr});
10
11 client.connect(null);
12
13 message = "GET / HTTP/1.1\r\nHost: www.google.com\r\n\r\n";
14
15 os = client.get_output_stream();
16 ds = new Gio.DataOutputStream.c_new(os);
17 ds.put_string(message);
18
19 os.flush();
20
21 input = new Gio.DataInputStream.c_new(client.get_input_stream());
22
23 out = input.read_until("", 0);
24 print(out);