Skip to content

Client proxy settings #57

Answered by arthurkushman
antonrykov asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, sure u can do this just like in code snippet from readme

<?php
use WSSC\WebSocketClient;
use WSSC\Components\ClientConfig;

$config = new ClientConfig();
$config->setFragmentSize(8096);
$config->setTimeout(15);
$config->setHeaders([
    'X-Custom-Header' => 'Foo Bar Baz',
]);

// if proxy settings is of need
$config->setProxy('127.0.0.1', '80');
$config->setProxyAuth('proxyUser', 'proxyPass');

$client = new WebSocketClient('ws://localhost:8000/notifications/messanger/yourtoken123', $config);

the only thing u need to do so, is by passing $config variable to WebSocketClient class

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by arthurkushman
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants