diff --git a/json.go b/json.go
index 97eb7c68324266d3c999a4df649f533cc34e9a5b..ca4ac924810d664c473e370c30cd2cdbf788f10d 100644
--- a/json.go
+++ b/json.go
@@ -4,7 +4,6 @@ import (
 	"context"
 	"encoding/json"
 
-	"golang.org/x/net/websocket"
 	"golang.org/x/xerrors"
 )
 
@@ -15,7 +14,7 @@ func ReadJSON(ctx context.Context, c *Conn, v interface{}) error {
 		return xerrors.Errorf("failed to read json: %w", err)
 	}
 
-	if typ != websocket.TextFrame {
+	if typ != Text {
 		return xerrors.Errorf("unexpected frame type for json (expected TextFrame): %v", typ)
 	}
 
@@ -32,7 +31,7 @@ func ReadJSON(ctx context.Context, c *Conn, v interface{}) error {
 
 // WriteJSON writes the json message v into c.
 func WriteJSON(ctx context.Context, c *Conn, v interface{}) error {
-	w := c.MessageWriter(websocket.TextFrame)
+	w := c.MessageWriter(Text)
 	w.SetContext(ctx)
 
 	e := json.NewEncoder(w)