Skip to content

client.subscribe() keeps creating new connections #7

@Fishdrowned

Description

@Fishdrowned

I see this in Chome devtool >> Network:
image

Client script:

<script src="../hprose/hprose-html5-2.0.34.js"></script>
<script type="text/javascript">
    !function () {
        var url = 'ws://127.0.0.1:2080/hello',
            subscriber = new hprose.WebSocketClient(url);
        subscriber.subscribe('push', function () {
            console.log(arguments);
        });
    }();
</script>

Server script:

use Hprose\Swoole\Server as Server;

$listen = 'ws://0.0.0.0:2080/hello';
$server = new Server($listen);
$server->publish('push');
$server->start();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions