rename and fix tcp example

This commit is contained in:
syumai 2024-01-03 21:22:52 +09:00
parent ac293fb733
commit 62ab08ac93
7 changed files with 5 additions and 10 deletions

View File

@ -1,6 +1,6 @@
# tcp
# sockets
- makes a connection to tcpbin.com:4242
- makes a TCP connection to tcpbin.com:4242.
## Development

View File

@ -11,12 +11,7 @@ import (
func main() {
handler := http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
dialer, err := sockets.NewDialer(req.Context(), nil)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
conn, err := dialer.Dial(req.Context(), "tcp", "tcpbin.com:4242")
conn, err := sockets.Connect(req.Context(), "tcpbin.com:4242", nil)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return

View File

@ -1,6 +1,6 @@
name = "tcp"
name = "sockets"
main = "./build/worker.mjs"
compatibility_date = "2023-02-24"
compatibility_date = "2024-01-03"
[build]
command = "make build"