Tag: proxy

使用php代理的跨域Ajax GET请求

在过去的几天里,我一直把头发拉过来。 我试图从公共API获得跨域ajax GET请求,但我根本无法让它工作。 PHP:我正在使用Ben Alman的ba-simple-proxy( https://github.com/cowboy/php-simple-proxy ) ‘ERROR’ ); } else if ( !preg_match( $valid_url_regex, $url ) ) { // Passed url doesn’t match $valid_url_regex. $contents = ‘ERROR: invalid url’; $status = array( ‘http_code’ => ‘ERROR’ ); } else { $ch = curl_init( $url ); if ( strtolower($_SERVER[‘REQUEST_METHOD’]) == ‘post’ ) { curl_setopt( $ch, CURLOPT_POST, […]