2015-09-24 01:23:26 +03:00
|
|
|
# Client and server example
|
|
|
|
|
|
|
|
This example shows a simple client and server.
|
|
|
|
|
2015-11-02 21:39:51 +03:00
|
|
|
The server echoes messages sent to it. The client sends a message every second
|
|
|
|
and prints all messages received.
|
2015-09-24 01:23:26 +03:00
|
|
|
|
|
|
|
To run the example, start the server:
|
|
|
|
|
|
|
|
$ go run server.go
|
|
|
|
|
|
|
|
Next, start the client:
|
|
|
|
|
|
|
|
$ go run client.go
|
|
|
|
|
2015-11-02 21:39:51 +03:00
|
|
|
The server includes a simple web client. To use the client, open
|
2015-11-02 22:10:34 +03:00
|
|
|
http://127.0.0.1:8080 in the browser and follow the instructions on the page.
|