Initial commit
This commit is contained in:
Binary file not shown.
@@ -0,0 +1,13 @@
|
||||
<script src="/ws/socket.io/socket.io.js"></script>
|
||||
<script>
|
||||
const socket = io("http://localhost", {
|
||||
path: '/ws/socket.io',
|
||||
query: 'id=123'
|
||||
});
|
||||
socket.on('data', (arg) => {
|
||||
console.log(arg);
|
||||
});
|
||||
</script>
|
||||
|
||||
<div id=test>
|
||||
</div>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
$ch = curl_init('http://push:8080/pub/123');
|
||||
# Setup request to send json via POST.
|
||||
$payload = json_encode( array( "customer"=> $data ) );
|
||||
curl_setopt( $ch, CURLOPT_POSTFIELDS, $payload );
|
||||
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
|
||||
# Return response instead of printing.
|
||||
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
|
||||
# Send request.
|
||||
$result = curl_exec($ch);
|
||||
var_export($result);
|
||||
curl_close($ch);
|
||||
# Print response.
|
||||
echo "<pre>$result</pre>";
|
||||
Reference in New Issue
Block a user