js EventSource

客户端:

var source = new EventSource("http://controller.shujudaping.com:8084?token=1");

服务器端:

<?php

header("Access-Control-Allow-Origin: *");

header('Content-Type: text/event-stream');

header('Cache-Control: no-cache');


$token = $_GET['token'];

echo "token: The token is: {$token}\n\n";

flush();

?>

怎么才能在服务器端拿到token的数据?

阿晨1998
浏览 1167回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript