https://github.com/jochasinga/quicksock
A quick example Go package to quickly create an instance of TCP socket client and server.
https://github.com/jochasinga/quicksock
Last synced: about 1 year ago
JSON representation
A quick example Go package to quickly create an instance of TCP socket client and server.
- Host: GitHub
- URL: https://github.com/jochasinga/quicksock
- Owner: jochasinga
- Created: 2015-01-28T02:18:33.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-01-30T01:11:55.000Z (over 11 years ago)
- Last Synced: 2025-02-02T09:26:37.481Z (over 1 year ago)
- Language: Go
- Size: 129 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
quicksock
=========
A quick example Go package to quickly create an instance of TCP socket client and server.
Install
-------
```Shell
$ go get github.com/jochasinga/quicksock
$ go install github.com/jochasinga/quicksock
```
Examples
--------
Creating a general client request to google.com:
```Go
package main
import qs "github.com/jochasinga/quicksock"
func main() {
qs.Client("tcp", "google.com", "www", "HEAD / HTTP/1.0\r\n\r\n")
}
```
Creating a TCP client:
```Go
package main
import qs "github.com/jochasinga/quicksock"
func main() {
qs.TCPClient("google.com:www")
}
```
Creating a TCP server:
```Go
package main
import qs "github.com/jochasinga/quicksock"
func main() {
qs.TCPServer("8080")
```