我正在创建一些到HTTP服务器的暂停连接(彗星,反向ajax等).它工作正常,但我看到浏览器只允许两个同时挂起到给定域的连接.因此,如果用户在浏览器的Tab1中查看我的网站,那么也尝试在Tab2中加载它们,他们已经用尽了两个允许的连接到我的网站.
我想我可以做一些通配域的东西,我有我的http服务器解析我的网站的任何地址,如:
*.example.com/webapp -> 192.0.2.1 (the actual ip of my server)
Run Code Online (Sandbox Code Playgroud)
所以:
a.example.com/webapp
b.example.com/webapp
c.example.com/webapp
Run Code Online (Sandbox Code Playgroud)
所有仍然指向(www.example.com/webapp
)但浏览器认为它们是不同的域,所以我没有遇到2连接限制.这是真的?
即使这是真的 - 所有域中每个浏览器的活动连接数是否有限制?假设我使用上面的方案 - 例如,Firefox在任何给定时间只允许24个并行连接吗?就像是:
1) a.example.com/webapp
2) www.download.example/hugefile.zip
3) b.example.com/webapp
4) c.example.com/webapp
...
24) x.example.com/webapp
25) // Error - all 24 possible connections currently in use!
Run Code Online (Sandbox Code Playgroud)
我刚刚选择了24个连接/ Firefox作为示例.
html web-applications http persistent-connection web-performance
我希望我的网站使用类似http://192.0.2.2/...
和https://192.0.2.2/...
静态内容的URL ,以避免请求中不必要的cookie并避免额外的DNS请求.
有没有办法为此目的获得SSL证书?
我们为客户托管了许多Web应用程序.很明显,他们希望使用自己的域来引用这些应用程序,通常他们希望任何键入http://www.customer1.example
或http://customer1.example
转到其Web应用程序的用户.
我们面临的情况是,我们需要具备在不久的将来更改IP地址的灵活性.我们不希望依赖客户对其域名进行A记录更改.所以我们认为使用CNAME
记录会起作用,但是我们发现CNAME
记录不适用于根域.
基本上:
customer1.example IN CNAME customer1.mycompanydomain.example //this is invalid as the RFC
www.customer1.example IN CNAME customer1.mycompanydomain.example //this is valid and will work
Run Code Online (Sandbox Code Playgroud)
我们希望能够更改IP地址customer1.mycompanydomain.example
或A
记录,我们的客户将遵循我们控制的记录.
在我们的DNS中它看起来像:
customer1.mycompanydomain.example IN A 192.0.2.1
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
我想设置以下内容:
auth.example.com
sub1.example.com
sub2.example.com
Run Code Online (Sandbox Code Playgroud)
如果用户访问sub1.domain.com或sub2.domain.com且他们未登录,则会将其推送到auth.domain.com并登录.sub1.domain.com和sub2.domain.com是两个单独的应用程序但使用相同的凭据.
我尝试在php.ini中设置以下内容:
session.cookie_domain = ".example.com"
Run Code Online (Sandbox Code Playgroud)
但它似乎没有将信息从一个域传递到另一个域.
[编辑]
我尝试了以下方法:
sub1.domain.com/test.php
session_set_cookie_params(0, '/', '.example.com');
session_start();
print session_id() . "<br>";
$_SESSION['Regsitered'] = 1;
echo '<a href="http://auth.example.com/test.php">Change Sites</a>'
Run Code Online (Sandbox Code Playgroud)
auth.domain.com/test.php
session_set_cookie_params(0, '/', '.example.com');
session_start();
print session_id() . "<br>";
$_SESSION['Checked'] = 1;
print_r($_SESSION);
Run Code Online (Sandbox Code Playgroud)
会话ID完全相同但是当我转出$ _SESSION变量时,它不显示两个键,只是我在每个域下设置的任何键.
[编辑2]
我更新了[编辑]
我似乎无法找到如何使用react-router更新查询参数而不使用<Link/>
.hashHistory.push(url)
似乎没有注册查询参数,似乎你不能将查询对象或任何东西作为第二个参数传递.
如何从更改URL /shop/Clothes/dresses
,以/shop/Clothes/dresses?color=blue
在反应路由器没有使用<Link>
?
并且onChange
函数真的是监听查询更改的唯一方法吗?为什么不自动检测到查询更改并对响应更改的方式做出反应?
例如,当我们连接时www.example.com
,首先我们尝试连接192.0.2.1
.如果第一次尝试失败,那么我们尝试192.0.2.222
.
可能吗?我们可以为一个域名注册多个备份IP地址吗?
在通过SQL SERVER 2008的新功能SPARSE COLUMN的一些教程之后,我发现如果列值为0或null它不占用任何空间但是当有值时,它需要4倍的常规空间(非稀疏)列保持.
如果我的理解是正确的,那么为什么我会在数据库设计时采用这种方法呢?如果我使用它,那么在什么情况下,我呢?
出于好奇,当列被定义为稀疏列时,怎么没有空间得到保留(我的意思是说,内部实现是什么)
提前致谢
就我而言,当我滚动列表时,工具栏会消失.我正在使用CollapsingToolbarLayout,我需要设置标题文本.但在我的情况下标题文本没有显示,即使我已经设置它(参见下面的代码).怎么了?
布局代码:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.design.widget.CoordinatorLayout
android:id="@+id/coordinator"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:theme="@style/AppTheme.AppBarOverlay"
app:elevation="0dp">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:fitsSystemWindows="true"
app:layout_scrollFlags="scroll|enterAlways">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:elevation="0dp"
android:minHeight="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="@style/AppTheme.PopupOverlay">
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</android.support.design.widget.CoordinatorLayout>
<android.support.design.widget.NavigationView
android:id="@+id/nav_view"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="start"
app:headerLayout="@layout/app_nav_header_main"
app:menu="@menu/main_drawer" />
</android.support.v4.widget.DrawerLayout>
Run Code Online (Sandbox Code Playgroud)
活动代码:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.app_activity_with_left_panel);
mPreferences = PreferenceManager.getDefaultSharedPreferences(this);
mToolbar = (Toolbar) findViewById(R.id.toolbar);
mCollapsingToolbarLayout = (CollapsingToolbarLayout)findViewById(R.id.collapsing);
setSupportActionBar(mToolbar);
setTitle(getIntent().getStringExtra(TITLE));
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeButtonEnabled(true);
}
@Override …
Run Code Online (Sandbox Code Playgroud) 我试图在运行时使用代理创建URL连接.我的代码如下:
Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("192.0.2.100", 80));
HttpURLConnection connection =
(HttpURLConnection)new URL("http://abc.example.com").openConnection(proxy);
Run Code Online (Sandbox Code Playgroud)
但这不起作用.谁知道为什么?
dns ×3
android ×1
android-collapsingtoolbarlayout ×1
cname ×1
connection ×1
cross-domain ×1
git ×1
html ×1
http ×1
https ×1
ip-address ×1
java ×1
networking ×1
php ×1
proxy ×1
react-router ×1
reactjs ×1
rfc ×1
session ×1
sql ×1
sql-server ×1
url ×1