localhost

vue-cli 3.0之跨域请求devServer proxy代理配置

醉酒当歌 提交于 2019-12-04 20:07:33
vue-cli 3.0之跨域请求devServer proxy代理配置 当我们的前端服务和后端服务不同源即 协议不同 , 端口不同 , 域名不同 时,就会出现跨域的问题。 通过配置devServer.proxy就可以解决跨域的问题。 基本配置: // 将任何未知请求 (没有匹配到静态文件的请求) 代理到http://localhost:4000 module.exports = { devServer: { proxy: 'http://localhost:4000' } } 详细配置: dev-server.proxy使用功能强大的 http-proxy-middleware 软件包。 假如我们需要请求:http://common.dm.com/api/loginPost 但实际请求是:http://localhost:3000/api/loginPost 我们需要请求到 http://common.dm.com 下的接口就需要配置: module.exports = { devServer: { proxy: { // 只有碰到/api的才会执行代理 '/api': { target: 'http://common.dm.com', // 要访问的跨域的域名 ws: true, // 是否启用websockets changeOrigin: true // 开启代理

How to test AWS SNS locally?

柔情痞子 提交于 2019-12-04 19:58:39
问题 I want to use Amazon SNS service . And I want to have an ability to subscribe an http rest to SNS topic to receive notifications. However locally my application has URL as localhost So it's impossible for me to test application behavior locally. I found one article about using ngrok server, to use some public IP instead of local. However it doesn't seem to be a good solution for me. Do you have any ideas how I could have a working SNS subscriber locally? 回答1: You could also use ngrok to

How to connect from docker-compose to Host PostgreSQL?

╄→尐↘猪︶ㄣ 提交于 2019-12-04 19:58:33
I have a server with installed PostgreSQL. All my services work in containers (docker-compose). I want to use my Host PostgreSQL from containers. Buy I have the error: Unable to obtain Jdbc connection from DataSource (jdbc:postgresql://localhost:5432/shop-bd) for user 'shop-bd-user': Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections. -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Nginx 配置从零开始

吃可爱长大的小学妹 提交于 2019-12-04 19:28:43
作为一个 nginx 的初学者记录一下从零起步的点滴。 基本概念 Nginx 最常的用途是提供反向代理服务,那么什么反向代理呢?正向代理相信很多大陆同胞都在这片神奇的土地上用过了,原理大致如下图: 代理服务器作为客户端这边的中介接受请求,隐藏掉真实的客户,向服务器获取资源。如果代理服务器在长城外的话还能顺便帮助我们实现翻越长城的目的。而反向代理顾名思义就是反过来代理服务器作为服务器的中介,隐藏掉真实提供服务的服务器,原理大致如下图: 这么做当然不是为了实现翻越长城,而是为了实现安全和负载均衡等一系列的功能。所谓安全指客户端的请求不会直接落到内网的服务器上而是通过代理做了 一层转发,在这一层就可以实现安全过滤,流控,防 DDOS 等一系列策略。而负载均衡指我们可以水平扩展后端真正提供服务的服务器数量,代理按规则转发请求到各个服务器,使得各个服务器的负载接近均衡。 而 nginx 就是目前流行的这样一个反向代理服务。 安装 在 Ubuntu 下,可以舍去编译安装的过程,直接 apt-get sudo apt-get install nginx 安装好之后可以直接通过: sudo service nginx start 来启动 nginx 服务,nginx 默认设置了 80 端口的转发,我们可以再浏览器访问 http://locallhost 来进行检查。 初始配置 nginx

How to intercept local server web requests using Burp in Internet Explorer

和自甴很熟 提交于 2019-12-04 18:56:10
I have properly configured Burp to intercept at a proxy location at 127.0.0.1:9090 My Internet Explorer proxy settings are as follows: Also I have a webserver named WebGoat running in http://localhost:8080/WebGoat/ All the requests are not being intercepted by Burp, in any way. What Should I do? Try adding a '.' after "localhost". This should solve your problem. eg. http://localhost.:8080/WebGoat/ This will force the localhost to use the same proxy settings as one would with an internet connection/adapter. Using IE9 and above version: Internet Options -> Connections Tab LAN settings Under

Access local host website in Android device through wifi

微笑、不失礼 提交于 2019-12-04 18:30:42
问题 I am developing one website which is need to host in local system and access this website in all device through WiFi. My system in which I publish website in IIS is Connected in LAN. And WiFi is also from same router. I need to access this website in all device which is connected in WiFi. How can I achieve this? If you have any other suggestion to do this than than please let me know. 回答1: You need to add an inbound rule in the firewall for port 80 (or whatever port you used for your website

HttpAddUrl on localhost fails for non-admin users

一曲冷凌霜 提交于 2019-12-04 18:06:33
Using the Windows HTTP API I'm running a HTTP file server on localhost. This involves calling HttpAddUrl(hRequestQueue, L"http://localhost:80/", NULL) . This fails with ERROR_ACCESS_DENIED unless the user runs the application as administrator. I need this functionality for users who don't have admin privileges. (What's wrong with a user running a localhost server anyway? It's just for the user themselves.) I found a hotfix for Vista and XP which seems aimed at solving this, but there's nothing for Windows 7. The article implies it was fixed in Vista SP1, and I have Windows 7 SP1 and it's still

ONOS安装

心不动则不痛 提交于 2019-12-04 17:56:28
本机安装教程(ubuntu) https://wiki.onosproject.org/display/ONOS/Developer+Quick+Start 安装bazel: https://docs.bazel.build/versions/master/install-ubuntu.html 其他依赖: git zip curl unzip python # 2.7 required by some development scripts python3 # Required by Bazel bzip2 # Needed by legacy GUI build 安装onos git clone https://gerrit.onosproject.org/onos cd onos bazel build onos onos编译安装报错解决办法 https://blog.csdn.net/daihanglai7622/article/details/88642998?tdsourcetag=s_pctim_aiomsg 运行onos bazel run onos-local -- clean debug # 'clean' to delete all previous running status # 'debug' to enable remote debugging

PHP大量数据循环时内存耗尽问题的解决方案

余生长醉 提交于 2019-12-04 17:39:22
最近在开发一个PHP程序时遇到了下面的错误: PHP Fatal error: Allowed memory size of 268 435 456 bytes exhausted 错误信息显示允许的最大内存已经耗尽。遇到这样的错误起初让我很诧异,但转眼一想,也不奇怪,因为我正在开发的这个程序是要用一个 foreach 循环语句在一个有4万条记录的表里全表搜索具有特定特征的数据,也就是说,一次要把4万条数据取出,然后逐条检查每天数据。可想而知,4万条数据全部加载到内存中,内存不爆才怪。 毕竟编程这么多年,我隐约记得PHP里提供有非一次全部加载数据的API,是像处理流媒体那样,随用随取随丢、数据并不会积累在内存的查询方法。经过简单的搜索,果然在官方网站上找到的正确的用法。 这个问题在PHP的官方网站上叫 缓冲查询和非缓冲查询(Buffered and Unbuffered queries) 。 PHP的查询缺省模式是缓冲模式。也就是说,查询数据结果会一次全部提取到内存里供PHP程序处理。这样给了PHP程序额外的功能,比如说,计算行数,将 指针指向某一行等。更重要的是程序可以对数据集反复进行二次查询和过滤等操作。但这种缓冲查询模式的缺陷就是消耗内存,也就是用空间换速度。 相对的,另外一种PHP查询模式是非缓冲查询,数据库服务器会一条一条的返回数据,而不是一次全部返回

TNS-12541: TNS:no listener TNS-12560: TNS:protocol adapter error TNS-00511: No listener Linux Error:

懵懂的女人 提交于 2019-12-04 17:36:03
今天是2014-06-17,遇到一个非常奇怪的问题,可能之前测试修改监听的原因,导致监听启动后自动关闭,特此记录一下整个处理过程, 监听配置文件信息如下: [oracle@dg1 admin]$ more listener.ora # listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora # Generated by Oracle configuration tools. LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.4.181)(PORT = 1521)) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) ) ADR_BASE_LISTENER = /u01/app/oracle SID_LIST_LISTENER= (SID_LIST= (SID_DESC= (GLOBAL_DBNAME=dg1) (ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1) (SID_NAME=dg1) ) )