为什么要获取客户端 ip: 分析原因: 前端给 php 传递的 ip 字段值是 req.connection.remoteAddress ,理论上没什么不对,但实际拿到是 ipv6 的地址,php 需要的 ipv4 的地址。 nodejs 官网 API: net 模块查找 server.listen ...
分类:
Web程序 时间:
2017-12-24 12:46:45
阅读次数:
157
文件路径:includes/ueditor/php/imageUp.php //添加水印,载入水印需要的文件 @author Abner @time 20171221 start define('IN_ECS', true); require_once( '../../init.php'); req ...
分类:
其他好文 时间:
2017-12-21 19:40:51
阅读次数:
179
golang中_有两种作用,一种用在import中,比如这样import _ "github.com/go-sql-driver/mysql",表示并不需要导入整个包,只是执行这个包里面所有的init函数。另一个作用就是作为变量的占位符,比如req, _ := http.NewRequest(... ...
分类:
其他好文 时间:
2017-12-21 16:04:10
阅读次数:
91
参考: 运维人员的日常 关于限制用户连接,Nginx 提供的模块: ngx_http_limit_req_module , ngx_http_limit_conn_module , 还有 stream 模块也包含类似的功能, 本文只说明 ngx_http_limit_req_module 的使用 n ...
分类:
其他好文 时间:
2017-12-19 15:09:27
阅读次数:
142
0. 1.参考 【工作】Nginx限制IP并发连接数和请求数的研究 Module ngx_http_limit_conn_module Module ngx_http_limit_req_module 漏桶算法和 NGINX 的 limit_req 模块 漏桶这个名字,其实就非常形象的描述了算法本身 ...
分类:
其他好文 时间:
2017-12-18 18:53:18
阅读次数:
2794
一、首先什么是node? 二、node初体验: 1 //引入http模块 2 const http = require('http'); 3 // 新建一个函数 作为sever的回调函数 其中req 是请求相关的内容 res是返回相关的内容 4 const func = (req,res) => { ...
分类:
Web程序 时间:
2017-12-18 18:43:47
阅读次数:
256
System.out.println("contextPath:"+req.getContextPath()); System.out.println("servletPath:"+req.getServletPath()); System.out.println("requestURI:"+req ...
分类:
其他好文 时间:
2017-12-16 17:24:48
阅读次数:
142
<%@ page language="java" import="java.util.*" import="java.sql.*" pageEncoding="UTF-8"%><%String path = request.getContextPath();String basePath = req ...
分类:
其他好文 时间:
2017-12-14 23:51:50
阅读次数:
191
使用@RequestParam可以将URL中的请求参数,绑定到方法的入参上,并通过@RequestParam的3个参数进行配置 Modifier and Type Optional Element Description String defaultValue 方法入参默认值 boolean req ...
分类:
编程语言 时间:
2017-12-14 20:57:03
阅读次数:
140
<%@ page language="java" import="java.util.*" import="java.sql.*" pageEncoding="UTF-8"%><%String path = request.getContextPath();String basePath = req ...
分类:
其他好文 时间:
2017-12-13 02:23:08
阅读次数:
209