# `mix phx.gen.socket`
[🔗](https://github.com/phoenixframework/phoenix/blob/v1.8.17/lib/mix/tasks/phx.gen.socket.ex#L1)

Generates a Phoenix socket handler.

    $ mix phx.gen.socket User

Accepts the module name for the socket.

The generated files will contain:

For a regular application:

  * a client in `assets/js`
  * a socket in `lib/my_app_web/channels`

For an umbrella application:

  * a client in `apps/my_app_web/assets/js`
  * a socket in `apps/my_app_web/lib/my_app_web/channels`

You can then generate channels with `mix phx.gen.channel`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
