propromo-software / demo

A demo project to show and test what Propromo can do.
https://propromo-software.github.io/demo/
Other
0 stars 0 forks source link

Create a chat-client demo using the standard browser WebSockets API (php). #38

Open jonasfroeller opened 6 months ago

jonasfroeller commented 6 months ago

https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_client_applications

jonasfroeller commented 6 months ago

vanilla-chat and sveltekit-chat can help with that.

jonasfroeller commented 5 months ago

waiting for https://github.com/sirn-se/websocket-php/tree/v3.0-main

Declaration of WebSocket\Client::setLogger(Psr\Log\LoggerInterface $logger): WebSocket\Client must be compatible with Psr\Log\LoggerAwareInterface::setLogger(Psr\Log\LoggerInterface $logger): void

jonasfroeller commented 5 months ago

Property type not supported in Livewire for property: [{}]

jonasfroeller commented 5 months ago

Maximum execution time of 60 seconds exceeded PHP is blocking

Connection opened for chat room $2y$12$W3pHWdAtePn1wjCm4.t4xO9lY9jOcu8/5SC0bDEsaAfSB8pKA5k.K
Connection errored for chat room $2y$12$W3pHWdAtePn1wjCm4.t4xO9lY9jOcu8/5SC0bDEsaAfSB8pKA5k.K
Connection closed for chat room $2y$12$W3pHWdAtePn1wjCm4.t4xO9lY9jOcu8/5SC0bDEsaAfSB8pKA5k.K
Connection closed for chat room $2y$12$W3pHWdAtePn1wjCm4.t4xO9lY9jOcu8/5SC0bDEsaAfSB8pKA5k.K
Connection opened for chat room $2y$12$IDPqikVpYsvrba6yJ8zyxe.iMpotiWVjT0opH2Mdo9PuVZfsAqmrO
Connection errored for chat room $2y$12$IDPqikVpYsvrba6yJ8zyxe.iMpotiWVjT0opH2Mdo9PuVZfsAqmrO
Connection closed for chat room $2y$12$IDPqikVpYsvrba6yJ8zyxe.iMpotiWVjT0opH2Mdo9PuVZfsAqmrO
Connection closed for chat room $2y$12$IDPqikVpYsvrba6yJ8zyxe.iMpotiWVjT0opH2Mdo9PuVZfsAqmrO
Connection errored for chat room y$IDPqikVpYsvrba6yJ8zyxe.iMpotiWVjT0opH2Mdo9PuVZfsAqmrO ErrorEvent {
  bubbles: false,
  cancelable: false,
  composed: false,
  currentTarget: WebSocket {
    url: "",
    readyState: 3,
    extensions: "",
    protocol: "",
    binaryType: "arraybuffer",
    bufferedAmount: 0,
    onmessage: [Function (anonymous)],
    onerror: [Function (anonymous)],
    onclose: [Function (anonymous)],
    onopen: [Function (anonymous)]
  },
  defaultPrevented: false,
  eventPhase: 2,
  srcElement: null,
  target: WebSocket {
    url: "",
    readyState: 3,
    extensions: "",
    protocol: "",
    binaryType: "arraybuffer",
    bufferedAmount: 0,
    onmessage: [Function (anonymous)],
    onerror: [Function (anonymous)],
    onclose: [Function (anonymous)],
    onopen: [Function (anonymous)]
  },
  returnValue: true,
  timeStamp: 0,
  type: "error",
  message: "No response from ping frame.",
  filename: "",
  lineno: 0,
  colno: 0,
  error: undefined
} {
  binaryType: "arraybuffer",
  close: [Function: close],
  protocol: [Getter],
  raw: WebSocket {
    url: "",
    readyState: 3,
    extensions: "",
    protocol: "",
    binaryType: "arraybuffer",
    bufferedAmount: 0,
    onmessage: [Function (anonymous)],
    onerror: [Function (anonymous)],
    onclose: [Function (anonymous)],
    onopen: [Function (anonymous)]
  },
  readyState: [Getter],
  url: null,
  send: [Function: send]
}
Connection closed for chat room y$IDPqikVpYsvrba6yJ8zyxe.iMpotiWVjT0opH2Mdo9PuVZfsAqmrO CloseEvent {
  bubbles: false,
  cancelable: false,
  composed: false,
  currentTarget: WebSocket {
    url: "",
    readyState: 3,
    extensions: "",
    protocol: "",
    binaryType: "arraybuffer",
    bufferedAmount: 0,
    onmessage: [Function (anonymous)],
    onerror: [Function (anonymous)],
    onclose: [Function (anonymous)],
    onopen: [Function (anonymous)]
  },
  defaultPrevented: false,
  eventPhase: 2,
  srcElement: null,
  target: WebSocket {
    url: "",
    readyState: 3,
    extensions: "",
    protocol: "",
    binaryType: "arraybuffer",
    bufferedAmount: 0,
    onmessage: [Function (anonymous)],
    onerror: [Function (anonymous)],
    onclose: [Function (anonymous)],
    onopen: [Function (anonymous)]
  },
  returnValue: true,
  timeStamp: 0,
  type: "close",
  wasClean: true,
  code: 1005,
  reason: ""
} {
  binaryType: "arraybuffer",
  close: [Function: close],
  protocol: [Getter],
  raw: WebSocket {
    url: "",
    readyState: 3,
    extensions: "",
    protocol: "",
    binaryType: "arraybuffer",
    bufferedAmount: 0,
    onmessage: [Function (anonymous)],
    onerror: [Function (anonymous)],
    onclose: [Function (anonymous)],
    onopen: [Function (anonymous)]
  },
  readyState: [Getter],
  url: null,
  send: [Function: send]
}
jonasfroeller commented 5 months ago

Invalid status code 401.

WebSocket \ Exception\ HandshakeException

jonasfroeller commented 5 months ago
Connection opened for chat room $2y$12$W3pHWdAtePn1wjCm4.t4xO9lY9jOcu8/5SC0bDEsaAfSB8pKA5k.K
Connection errored for chat room $2y$12$W3pHWdAtePn1wjCm4.t4xO9lY9jOcu8/5SC0bDEsaAfSB8pKA5k.K
Connection closed for chat room $2y$12$W3pHWdAtePn1wjCm4.t4xO9lY9jOcu8/5SC0bDEsaAfSB8pKA5k.K
error: Uncaught (in promise) InvalidStateError: readyState not OPEN
    send: (source) => socket.send(source),
                             ^
jonasfroeller commented 5 months ago

https://www.php.net/manual/en/function.exec.php#88704 https://stackoverflow.com/questions/6107339/parallel-processing-in-php-how-do-you-do-it https://livewire.laravel.com/docs/lifecycle-hooks#mount