openssl genrsa -out server.key 2048
openssl req -new -x509 -key server.key -out server.pem -days 3650
| # This config file was created for myself (@janlay). You may want to add or remove some rules to make efficient use of the Internet. | |
| # This file depends on the main.conf which defines your own proxy. | |
| # Your main.conf will look like this: | |
| # ---- START ---- | |
| # #!PROXY-OVERRIDE:rules.conf | |
| # [Proxy] | |
| # Proxy = https,server.address,port,username,password | |
| # ---- END ---- | |
| # |
| #import <Foundation/Foundation.h> | |
| @interface Communicator : NSObject <NSStreamDelegate> { | |
| @public | |
| NSString *host; | |
| int port; | |
| } | |
| - (void)setup; |
| #user nobody; | |
| #Defines which Linux system user will own and run the Nginx server | |
| worker_processes 1; | |
| #Referes to single threaded process. Generally set to be equal to the number of CPUs or cores. | |
| #error_log logs/error.log; #error_log logs/error.log notice; | |
| #Specifies the file where server logs. |
| // 配置信息的token随意填,和这里的一样就行 | |
| var PORT = 8080; //监听8080端口号 | |
| var http = require('http'); | |
| var qs = require('querystring'); | |
| var TOKEN = 'beiweiqiang'; //必须与测试号所填写的Token相同 | |
| function checkSignature(params, token) { | |
| var key = [token, params.timestamp, params.nonce] | |
| .sort() | |
| .join(''); |
| package main | |
| import ( | |
| "flag" | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "os" | |
| "golang.org/x/net/webdav" |
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |