forked from OzzyFrost/testWebSocket
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
23 lines (22 loc) · 666 Bytes
/
Main.java
File metadata and controls
23 lines (22 loc) · 666 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import java.net.UnknownHostException;
import java.io.IOException;
//public class Main {
//
// public static void main(String[] args) {
// String host = "www.lib.ru";
// Socket socket = new Socket(host, 80);
// String request = "GET / HTTP/1.0\r\n\r\n";
// OutputStream os = socket.getOutputStream();
// os.write(request.getBytes());
// os.flush();
//
// InputStream is = socket.getInputStream();
// int ch;
// while( (ch=is.read())!= -1)
// System.out.print((char)ch);
// socket.close();
// }
//}